asp.net.ph

DataSet.WriteXmlSchema Method ( TextWriter )

System.Data Namespace   DataSet Class


Writes the DataSet structure as an XML schema to a TextWriter object.

[ VB ]
Overloads Public Sub WriteXmlSchema ( _
   ByVal writer As TextWriter _
)

[ C# ]
public void WriteXmlSchema (
   TextWriter writer
);

[ C++ ]
public: void WriteXmlSchema (
   TextWriter* writer
);

[ JScript ]
public function WriteXmlSchema (
   writer : TextWriter
);

Parameters

writer
The TextWriter object with which to write.

Remarks

Use the WriteXmlSchema method to write the schema for a DataSet to an XML document. 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.

To write the data to an XML document, use the WriteXml method.

Classes the derive from the System.IO.TextWriter class include the System.Web.HttpWriter, System.CodeDOM.Compiler.IndentedTextWriter, System.Web.UI.IndentedTextWriter, System.IO.StreamWriter, and System.IO.StringWriter.

Example

The following example initializes a System.Text.StringBuilder object to that is used to create a new System.IO.StringWriter. The StringWriter is passed to the WriteXmlSchema method, and the resulting string is written to the page.

private void WriteSchemaWithStringWriter ( DataSet thisDataSet ) {
   // create a new StringBuilder object.
   System.Text.StringBuilder mysb = new System.Text.StringBuilder ( );
   // create the StringWriter object with the StringBuilder object.
   System.IO.StringWriter myStringWriter = 
      new System.IO.StringWriter ( mysb );
   // write the schema into the StringWriter.
   thisDataSet.WriteXmlSchema ( myStringWriter );
   // print the string.
   Response.Write ( myStringWriter.ToString ( ) );
}
  C# VB

See Also

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




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

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

You can help support asp.net.ph