dataset to xmlfile
-
I am having trouble writing data to my xml file. I already have a StreamReader that reads the data, but when I use StreamWriter to write the data back out to the file, it writes data, but it writes blank data. It clears my file so the next time I try to run my program an error message says it can't find the origional table that was in my file before, of course thats because it isn't there now. any suggestions on what I may be doing wrong? I am writing from a form with a datagrid. HAPPY HOLIDAYS
-
I am having trouble writing data to my xml file. I already have a StreamReader that reads the data, but when I use StreamWriter to write the data back out to the file, it writes data, but it writes blank data. It clears my file so the next time I try to run my program an error message says it can't find the origional table that was in my file before, of course thats because it isn't there now. any suggestions on what I may be doing wrong? I am writing from a form with a datagrid. HAPPY HOLIDAYS
You are probably not closing the file properly after you have written to it. Have a look at the
DataSet.ReadXml
andDataSet.WriteXml
on MSDN, both have examples of how to code it properly: DataSet.ReadXml - MSDN[^] DataSet.WriteXml - MSDN[^] Hope this helps Tom