Hi, I am new to programming in vb. net. I have this problem:
I created a form with a datagrid. I can add records and then save them to a XML file, using this code on the click event of a button (my dataset is called Maxdata1):
Dim fs As Stream
Me.BindingConte xt(Maxdata1, "addresses").En dCurrentEdit()
fs = New FileStream("D:\ temp\maxdata.xm l", FileMode.OpenOr Create)
Maxdata1.WriteX ml(fs)
fs.Close()
This works fine, and I can retrieve the data from the xml file as well. Now here is the problem: when I delete a record in the grid and then save the data to the XML file, the file is corrupted and does not have the nodes of the data anymore.
Is there a special action I have to take after deleting a record, before I save the data to the file?
Thx,
emphyrio
I created a form with a datagrid. I can add records and then save them to a XML file, using this code on the click event of a button (my dataset is called Maxdata1):
Dim fs As Stream
Me.BindingConte xt(Maxdata1, "addresses").En dCurrentEdit()
fs = New FileStream("D:\ temp\maxdata.xm l", FileMode.OpenOr Create)
Maxdata1.WriteX ml(fs)
fs.Close()
This works fine, and I can retrieve the data from the xml file as well. Now here is the problem: when I delete a record in the grid and then save the data to the XML file, the file is corrupted and does not have the nodes of the data anymore.
Is there a special action I have to take after deleting a record, before I save the data to the file?
Thx,
emphyrio
Comment