public:
void ReadXmlSchema(System::IO::Stream ^ stream);
public void ReadXmlSchema(System.IO.Stream? stream);
public void ReadXmlSchema(System.IO.Stream stream);
member this.ReadXmlSchema : System.IO.Stream -> unit
Public Sub ReadXmlSchema (stream As Stream)
Parameters Examples
The following example creates a FileStream object to read an XML schema with, and invokes the ReadXmlSchema method with the object.
private void ReadSchemaFromFileStream(DataSet thisDataSet)
{
// Set the file path and name.
// Modify this for your purposes.
string filename="Schema.xml";
// Create the FileStream object with the file name,
// and set to open the file.
System.IO.FileStream stream =
new System.IO.FileStream(filename,System.IO.FileMode.Open);
// Read the schema into the DataSet.
thisDataSet.ReadXmlSchema(stream);
// Close the FileStream.
stream.Close();
}
Private Sub ReadSchemaFromFileStream(thisDataSet As DataSet)
' Set the file path and name. Modify this for your purposes.
Dim filename As String = "Schema.xml"
' Create the FileStream object with the file name,
' and set to open the file
Dim stream As New System.IO.FileStream _
(filename, System.IO.FileMode.Open)
' Read the schema into the DataSet.
thisDataSet.ReadXmlSchema(stream)
' Close the FileStream.
stream.Close()
End Sub
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.
Note
Data corruption can occur if the msdata:DataType and the xs:type types do not match. No exception will be thrown.
The ReadXmlSchema method is generally invoked before invoking the ReadXml method that is used to fill the DataSet.
Classes that derive from the Stream class include BufferedStream, FileStream, MemoryStream, and NetworkStream.
Note
If the schema for your DataSet contains elements of the same name, but different type, in the same namespace, an exception is be thrown when you attempt to read the schema into the DataSet with ReadXmlSchema. This exception does not occur if you are using .NET Framework version 1.0.
See alsoRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4