0
Using XML in a DataSet      (ADO.NET)              Ringo Ray H Piedraverde                  (Jr. Programmer)
Topics• Writing DataSet Contents as XML Data  (ADO.NET)• Loading a DataSet from XML (ADO.NET)
Writing DataSet Contents as XML          Data (ADO.NET)• WriteScheme Method  – Writes the current contents of the DataSet ...
Code SnippetDim mds As DataSet = mds.tables(“tblUser”)mUserDS.WriteXml(“User.xml", XmlWriteMode.WriteSchema)
Xml output
Loading a DataSet from XML               (ADO.NET)• To fill a DataSet with data from XML, use the ReadXml  method of the D...
Code snippetDim m_Ds as DatasetPublic sub ReadXML()m_User.ReadXml(“User.xml", XmlReadMode.ReadSchema)End Sub
Reading Output
• End
Upcoming SlideShare
Loading in...5
×

Using xml in a data set (ADO.NET)

466

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
466
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Using xml in a data set (ADO.NET)"

  1. 1. Using XML in a DataSet (ADO.NET) Ringo Ray H Piedraverde (Jr. Programmer)
  2. 2. Topics• Writing DataSet Contents as XML Data (ADO.NET)• Loading a DataSet from XML (ADO.NET)
  3. 3. Writing DataSet Contents as XML Data (ADO.NET)• WriteScheme Method – Writes the current contents of the DataSet as XML data with the relational structure as inline XML Schema.• WriteXml method – Using this method you can write the Dataset to a file, stream, or XmlWriter.
  4. 4. Code SnippetDim mds As DataSet = mds.tables(“tblUser”)mUserDS.WriteXml(“User.xml", XmlWriteMode.WriteSchema)
  5. 5. Xml output
  6. 6. Loading a DataSet from XML (ADO.NET)• To fill a DataSet with data from XML, use the ReadXml method of the DataSet object. The ReadXml method reads from a file, a stream, or an XmlReader, and takes as arguments the source of the XML.• The ReadXml method reads the contents of the XML stream or document and loads the DataSet with data. It will also create the relational schema of the DataSet depending on the XmlReadMode specified and whether or not a relational schema already exists.
  7. 7. Code snippetDim m_Ds as DatasetPublic sub ReadXML()m_User.ReadXml(“User.xml", XmlReadMode.ReadSchema)End Sub
  8. 8. Reading Output
  9. 9. • End
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×