Update XML File using DataSet

  • 9 years ago

    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 

    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.

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves” - Alan Kay