Hi Guys, I have a silly problem. Im binding my dataGridView to my xml source. It is loading and getting binded. All this is fine. Now once the data is loaded im trying to delete the last row and update my xml, but it gives the error that the last low does not exist. this happens only if i delete the last row only, if i delete any row in the middle, it deletes the row from the dataTable and then modifies the XML. But the problem is only when i delete the last row. Below is my code for deleting the row.
ds.Tables(0).Rows.RemoveAt((e.Row.Index))
ds.Tables(0).WriteXml(Application.StartupPath & "\data.xml")
When i run my program and delete the Last row, it gives error (but the xml file is modified). And then when I close the program and run it again , I get the data loaded in the grid with the last row deleted.
ANY HELP PLZZZZ!!!!
ds.Tables(0).Rows.RemoveAt((e.Row.Index))
ds.Tables(0).WriteXml(Application.StartupPath & "\data.xml")
When i run my program and delete the Last row, it gives error (but the xml file is modified). And then when I close the program and run it again , I get the data loaded in the grid with the last row deleted.
ANY HELP PLZZZZ!!!!