DataSet.WriteXmlSchema Method (String)


Writes the DataSet structure as an XML schema to a file.

Namespace:   System.Data
Assembly:  System.Data (in System.Data.dll)

Public Sub WriteXmlSchema (
	fileName As String


Type: System.String

The file name (including the path) to which to write.

Exception Condition

FileIOPermission is not set to Write.

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.

Private Sub WriteSchemaToFile(thisDataSet As DataSet)
    ' Set the file path and name. Modify this for your purposes.
    Dim filename As String = "Schema.xml"

    ' Write the schema to the file.
End Sub


for reading and writing files. Associated enumeration: FileIOPermissionAccess

.NET Framework
Available since 1.1
Return to top