System.Data Namespace DataSet Class
Reads XML schema and data into the DataSet.
1. Reads XML schema and data into the DataSet using the specified Stream.
2. Reads XML schema and data into the DataSet using the specified file.
3. Reads XML schema and data into the DataSet using the specified TextReader.
4. Reads XML schema and data into the DataSet using the specified XmlReader.
5. Reads XML schema and data into the DataSet using the specified Stream and XmlReadMode.
6. Reads XML schema and data into the DataSet using the specified file and XmlReadMode.
7. Reads XML schema and data into the DataSet using the specified TextReader and XmlReadMode.
8. Reads XML schema and data into the DataSet using the specified XmlReader and XmlReadMode.
The following example illustrates using the ReadXml method to load a given XML file into a DataSet.
NOTE: This example uses one of the overloaded versions of ReadXml. For other examples that may be available, see the individual overload topics.
protected void ReadXmlDemo ( ) {
// initialize dataset object
DataSet myData = new DataSet ( );
// read xml file into dataset
myData.ReadXml ( Server.MapPath ( "/adonet/demos/authors.xml" ) );
// call method to display dataset contents into html table
displayData ( myData );
}
protected sub ReadXmlDemo ( )
' initialize dataset object
dim myData as new DataSet ( );
' read xml file into dataset
myData.ReadXml ( Server.MapPath ( "/adonet/demos/authors.xml" ) )
' call method to display dataset contents into html table
displayData ( myData )
end sub |
|
C# |
VB |
DataSet Members DataSet.ReadXml Overload List ReadXmlSchema WriteXml WriteXmlSchema