oc A

oc A

  • NA
  • 30
  • 0

Update XML File using DataSet

Jul 19 2008 2:19 AM

Hai all ,

i am doing a VB.NET Windows Application .. In that i am populating the datagrid with the contents of an XML  File (using dataset) . In the datagrid if i make any changes , it should be updated to the XML File . How can i do this ? I did the coding like this .

Dim DS as new DataSet 

Dim
dsl As New DataSetDim onm, oc, od As Stream

FileNam = "OrgXML.xml"

DS.ReadXml(FileNam, XmlReadMode.DiffGram)

dsl = DS.GetChanges(DataRowState.Modified)

dsl.WriteXml(FileNam, XmlWriteMode.DiffGram)

But this code is not working .. I am getting the error that "Object Reference not set to instance of an object" How can i resolve this ? Any body plz help . its urgent.


Answers (1)