1

I fear that there's an obvious answer to this staring me in the face but I can't figure it out...

Basically, I'm making a program to store details for different people. I was planning to create an XML file for each member, and display them in a DataGridView when the form containing it is loaded. The details will be collected through text boxes on an "Add Member" form.

What I would like to know is: How can I create XML files in code once the information is submitted, and how would I go about showing the details in a DataGridView?

3
  • As for creating the xml, I'll suggest you to look into the XmlSerializer or this : stackoverflow.com/questions/11089275/…. And for the DataGridView, take a look to stackoverflow.com/questions/6092463/…
    – Xiaoy312
    Commented Apr 29, 2016 at 17:26
  • XmlSerializer is your most obvious option here :)
    – ManoDestra
    Commented Apr 29, 2016 at 17:28
  • The easiest method is to use a DataTable. You can create a datatable and then display in datagridview in one instruction datagridview1.DataSource = dt. The DataTable class has methods DataTable.ReaxXml() and DataTableWriteXml() which will read and save results. An XmlSerializer is much more complicated to use so why use it when the is a very easy method.
    – jdweng
    Commented Apr 29, 2016 at 19:57

0