asp.net.ph

DataSet.ReadXmlSchema Method ( Stream )

System.Data Namespace   DataSet Class


Reads the XML schema from the specified Stream into the DataSet.

[ VB ]
Overloads Public Sub ReadXmlSchema ( _
   ByVal stream As Stream _
)

[ C# ]
public void ReadXmlSchema (
   Stream stream
);

[ C++ ]
public: void ReadXmlSchema (
   Stream* stream
);

[ JScript ]
public function ReadXmlSchema (
   stream : Stream
 )

Parameters

stream
The Stream from which to read.

Remarks

Use the ReadXmlSchema method to create the schema for a DataSet. The schema includes table, relation, and constraint definitions. To write a schema to an XML document, use the WriteXmlSchema method.

The XML schema is written using the XSD standard.

The ReadXmlSchema method is generally invoked before invoking the ReadXml method which is used to fill the DataSet.

Example

The following shows an example of using this version of ReadXmlSchema.

private void ReadSchemaFromFileStream ( DataSet thisDataSet ) {
   // set the file path and name. Modify this for your purposes.
   string filename="mySchema.xml";
   // create the FileStream object with the file name, and set to open the file.
   System.IO.FileStream myFileStream = 
      new System.IO.FileStream ( filename,System.IO.FileMode.Open );
   // Read the schema into the DataSet.
   thisDataSet.ReadXmlSchema ( myFileStream );
   // close the FileStream.
   myFileStream.Close ( );
}
  C# VB

See Also

DataSet Members   DataSet.ReadXmlSchema Overload List   ReadXml   WriteXml   WriteXmlSchema Skip Navigation Links




Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note