Results 1 to 2 of 2

Thread: Generate Xml from DataSet

  1. #1
    monuindia2002 is offline VB.NET Forum Newbie
    .NET Framework
    Join Date
    Jan 2006
    Posts
    8
    Reputation
    0

    Generate Xml from DataSet

    Hi,
    I am populating a datagrid with a dataset, after making required changes user will press
    Save button, which will save updated records in dataset.
    after that i am generating an xml file from dataset like this
    <NewDataSet>
    <Person>
    <PERSONFNAME>ABC</PERSONFNAME>
    <PERSONLNAME>DEF</PERSONLNAME>
    <ENTRYDATE>2006-01-12</ENTRYDATE>
    <AGE>15</AGE>
    </Person>
    <Person>
    <PERSONFNAME>Mahesh</PERSONFNAME>
    <PERSONLNAME>Maheshwari</PERSONLNAME>
    <ENTRYDATE>2006-01-12</ENTRYDATE>
    <AGE>21</AGE>
    </Person>
    </NewDataSet>
    i want to add an attribute to all element which are modified by user.
    instead of this xml file i want to get an xml file like this
    <NewDataSet>
    <Person>
    <PERSONFNAME originalValue="XYZ">ABC</PERSONFNAME> (Changed by user in DataGrid)
    <PERSONLNAME originalValue="BBCA">DEF</PERSONLNAME> (Changed by user in DataGrid)
    <ENTRYDATE>2006-01-12</ENTRYDATE>
    <AGE originalValue="21">15</AGE> (Changed by user in DataGrid)
    </Person>
    <Person>
    <PERSONFNAME>Mahesh</PERSONFNAME>
    <PERSONLNAME>Maheshwari</PERSONLNAME>
    <ENTRYDATE>2006-01-12</ENTRYDATE>
    <AGE>21</AGE>
    </Person>
    </NewDataSet>
    How can i do that, Please help me
    Regards
    Mahesh

  2. #2
    Neal's Avatar
    Neal is offline VB.NET Forum Admin
    .NET Framework
    .NET 4.5
    Join Date
    Jul 2004
    Location
    Richmond, VA
    Posts
    1,248
    Reputation
    220
    Investigate the DataSet.WriteXML method.
    Neal
    VB.NET Forums Admin

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Harvest time tracking