Save TO xml FROM datagridview
-
Hi, how can i save the contents of a dgv to a xml file? i know how to read from xml to dgv. because the dataset has more that one table and the datagrid only display one table, im affraid o mess it when saving. I Checking it know, but if anyone can direct me to some link or code would be helpfull :-D
nelsonpaixao@yahoo.com.br trying to help & get help
-
Hi, how can i save the contents of a dgv to a xml file? i know how to read from xml to dgv. because the dataset has more that one table and the datagrid only display one table, im affraid o mess it when saving. I Checking it know, but if anyone can direct me to some link or code would be helpfull :-D
nelsonpaixao@yahoo.com.br trying to help & get help
Move your data to a DataSet/DataTable object(s) and the rest is easy. It's save to an XML file in one statement.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Hi, how can i save the contents of a dgv to a xml file? i know how to read from xml to dgv. because the dataset has more that one table and the datagrid only display one table, im affraid o mess it when saving. I Checking it know, but if anyone can direct me to some link or code would be helpfull :-D
nelsonpaixao@yahoo.com.br trying to help & get help
cast your datagridview.DataSource to DataTable then save its contents to XML file
DataTable myDataTable =(Datatable)dgv.DataSource;
myDataTable.WriteXml(filename);hope it helps
dhaim ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro" in the front line gave a lead, in the middle line build goodwill, in the behind give power support