Click here to Skip to main content
15,901,368 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys, Im currently trying to write the contents of my database table to an XML file. This can be done, however what I am trying to achieve is to display the information in a datagrid view, allow the user alter or add any records, and then be able to write out the contents of the database table, to an XML file.

Any Ideas?

Would be much appreciated
Posted

1 solution

Please see this article
http://www.dotnetheaven.com/uploadfile/prathore/datagridview09122007013411am/datagridview.aspx[^]
in which it is shown how to display the data in a DataGridView from an XML file.
Now, after making the modifications to the data and / or adding new data in the DataGridView, the following code can be used to write the data back to the XML file on disk for the file name referred to in the above article
C#
xmlDatadoc.DataSet.WriteXml(Application.StartupPath + "\\books.xml");
 
Share this answer
 
Comments
ProEnggSoft 8-Apr-12 12:57pm    
Good link. +5
VJ Reddy 8-Apr-12 13:10pm    
Thank you.
BBCokeley 9-Apr-12 10:39am    
thanks been looking for a solution to this for ages
thank you for taking the time, much appreciated
Regards Matt.
VJ Reddy 9-Apr-12 10:50am    
You're welcome.
Thanks for appreciation.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900