Writing Data Set Schema Information as XML Schema

To save a DataSet object's schema information, use the WriteXmlSchema method of the DataSet. You can save the XML schema information directly to a file, or you can write it to a stream. Call the WriteXmSchema method of a DataSet to save the schema of the entire DataSet or call the WriteXmlSchema method of an individual DataTable to write the schema from only that table.

The following code example saves the data in the NorthwindDataSet object's schema information to a file named Northwind.xsd.

NorthwindDataset.WriteXm1Schema("Northwind.xsd") // C#

NorthwindDataset.WriteXm1Schema("Northwind.xsd");

Was this article helpful?

0 0

Post a comment