December 2001
Beginner
976 pages
22h 4m
English
In addition to loading a DataSet from records in a database, you can also construct a DataSet and populate it using a defined XML Schema and content defined in an XML file. This allows you to load XML data and work with it as a DataSet. Here is an example Console application project that loads a DataSet from XML:
Imports System.Data.SqlClient
Imports System.Data.Common
Module Module1
Sub Main()
Dim ds As DataSet = New DataSet()
Try
ds.ReadXmlSchema("Authors.xsd")
ds.ReadXml("Authors.xml")
Console.WriteLine(ds.GetXmlSchema())
Console.WriteLine(ds.GetXml())
Catch ex As SqlException
Console.WriteLine(ex.Message)
End Try
End Sub
End Module
Note
In order to read these files, they must be in the “bin” folder ...
Read now
Unlock full access