❔ Help with program, datagridview to xml help
Hello Everyone, I'm new to c#(know a bit of c++ and python) and trying to make a simple program project. I have designed it layout wise how id like, functionality wise it works. However, I would like the datagridview to save when I close and reopen. From reading around I need to create an XML file. Ive tried a bunch of solutions online an they all seem to break my code. I would image the jest of what needs to happen is on application load the xml is read and loaded into the datagridview. Then when I enter text into the textbox and push the button it send to the xml file and datagridview.
Not sure what you need from me if you need my current code just let me know.
Thanks in advanced!
8 Replies
the current code is always needed
Which part? I havent even started on the xml because I dont know how to begin with it. The different code pages are weird. form1.cs or form1.designer.cs?
as a general approach, i believe you can get the dataset from the grid and from that save/load schema+data with its methods
i honestly should try to be sure
https://github.com/jmcatena91/Kill-On-Sight
This is what I have so far (It is for remembering who killed you in games so you can remember and kill them if you see them again)
GitHub
GitHub - jmcatena91/Kill-On-Sight: Kill on sight Program for keepin...
Kill on sight Program for keeping track of who you want to kill in mmo's - GitHub - jmcatena91/Kill-On-Sight: Kill on sight Program for keeping track of who you want to kill in mmo's
'stuff' would be 'assets' 😐
use a BindingList<T> to bind the data to your DataGridView then you can serialize the list and then deserialize the data on disk back into your list and rebind it
i tried also with dataset, it works, just in case
you just have to pay attention to set dataMember to the table name
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.