DataSet.WriteXmlSchema Método

Definición

Escribe la estructura del DataSet como un esquema XML.

Sobrecargas

WriteXmlSchema(String, Converter<Type,String>)

Escribe la estructura del DataSet como un esquema XML en un archivo.

WriteXmlSchema(Stream)

Escribe la estructura DataSet como un esquema XML al objeto Stream especificado.

WriteXmlSchema(TextWriter)

Escribe la estructura DataSet como un esquema XML al objeto TextWriter especificado.

WriteXmlSchema(String)

Escribe la estructura del DataSet como un esquema XML en un archivo.

WriteXmlSchema(XmlWriter)

Escribe la estructura del DataSet como un esquema XML en un objeto XmlWriter.

WriteXmlSchema(Stream, Converter<Type,String>)

Escribe la estructura DataSet como un esquema XML al objeto Stream especificado.

WriteXmlSchema(TextWriter, Converter<Type,String>)

Escribe la estructura de DataSet como un esquema XML en el objeto TextWriter especificado.

WriteXmlSchema(XmlWriter, Converter<Type,String>)

Escribe la estructura de DataSet como un esquema XML en el objeto XmlWriter especificado.

WriteXmlSchema(String, Converter<Type,String>)

Source:
DataSet.cs
Source:
DataSet.cs
Source:
DataSet.cs

Escribe la estructura del DataSet como un esquema XML en un archivo.

public:
 void WriteXmlSchema(System::String ^ fileName, Converter<Type ^, System::String ^> ^ multipleTargetConverter);
public void WriteXmlSchema (string fileName, Converter<Type,string> multipleTargetConverter);
member this.WriteXmlSchema : string * Converter<Type, string> -> unit
Public Sub WriteXmlSchema (fileName As String, multipleTargetConverter As Converter(Of Type, String))

Parámetros

fileName
String

Nombre del archivo en el que se va a escribir.

multipleTargetConverter
Converter<Type,String>

Un delegado usado para convertir Type en una cadena.

Se aplica a

WriteXmlSchema(Stream)

Source:
DataSet.cs
Source:
DataSet.cs
Source:
DataSet.cs

Escribe la estructura DataSet como un esquema XML al objeto Stream especificado.

public:
 void WriteXmlSchema(System::IO::Stream ^ stream);
public void WriteXmlSchema (System.IO.Stream? stream);
public void WriteXmlSchema (System.IO.Stream stream);
member this.WriteXmlSchema : System.IO.Stream -> unit
Public Sub WriteXmlSchema (stream As Stream)

Parámetros

stream
Stream

Objeto Stream utilizado para escribir en un archivo.

Ejemplos

En el ejemplo siguiente se crea un nuevo FileStream objeto que se pasa al WriteXmlSchema método para escribir el esquema en el disco.

private void WriteSchemaWithFileStream(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.
    // Use FileMode.Create.
    System.IO.FileStream stream =
        new System.IO.FileStream(filename,System.IO.FileMode.Create);

    // Write the schema to the file.
    thisDataSet.WriteXmlSchema(stream);

    // Close the FileStream.
    stream.Close();
}
Private Sub WriteSchemaWithFileStream(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. 
    ' Use FileMode.Create.
    Dim stream As New System.IO.FileStream _
        (filename, System.IO.FileMode.Create)

    ' Write the schema to the file.
    thisDataSet.WriteXmlSchema(stream)

    ' Close the FileStream.
    stream.Close()
End Sub

Comentarios

Use el WriteXmlSchema método para escribir el esquema de en DataSet un documento XML. El esquema incluye definiciones de tabla, relación y restricción. Para escribir un esquema en un documento XML, use el WriteXmlSchema método .

El esquema XML se escribe mediante el estándar XSD.

Para escribir los datos en un documento XML, use el WriteXml método .

Las clases que derivan de la Stream clase incluyen BufferedStream, FileStream, MemoryStreamy NetworkStream.

Consulte también

Se aplica a

WriteXmlSchema(TextWriter)

Source:
DataSet.cs
Source:
DataSet.cs
Source:
DataSet.cs

Escribe la estructura DataSet como un esquema XML al objeto TextWriter especificado.

public:
 void WriteXmlSchema(System::IO::TextWriter ^ writer);
public void WriteXmlSchema (System.IO.TextWriter? writer);
public void WriteXmlSchema (System.IO.TextWriter writer);
member this.WriteXmlSchema : System.IO.TextWriter -> unit
Public Sub WriteXmlSchema (writer As TextWriter)

Parámetros

writer
TextWriter

Objeto TextWriter con el que se va a escribir.

Ejemplos

En el ejemplo siguiente se crea un System.Text.StringBuilder objeto en que se usa para crear un objeto .System.IO.StringWriter StringWriter se pasa al WriteXmlSchema método y la cadena resultante se imprime en la ventana de la consola.

private void WriteSchemaWithStringWriter(DataSet thisDataSet)
{
    // Create a new StringBuilder object.
    System.Text.StringBuilder builder = new System.Text.StringBuilder();

    // Create the StringWriter object with the StringBuilder object.
    System.IO.StringWriter writer = new System.IO.StringWriter(builder);

    // Write the schema into the StringWriter.
    thisDataSet.WriteXmlSchema(writer);

    // Print the string to the console window.
    Console.WriteLine(writer.ToString());
}
Private Sub WriteSchemaWithStringWriter(thisDataSet As DataSet)
    ' Create a new StringBuilder object.
    Dim builder As New System.Text.StringBuilder()

    ' Create the StringWriter object with the StringBuilder object.
    Dim writer As New System.IO.StringWriter(builder)

    ' Write the schema into the StringWriter.
    thisDataSet.WriteXmlSchema(writer)

    ' Print the string to the console window.
    Console.WriteLine(writer.ToString())
End Sub

Comentarios

Use el WriteXmlSchema método para escribir el esquema de en DataSet un documento XML. El esquema incluye definiciones de tabla, relación y restricción. Para escribir un esquema en un documento XML, use el WriteXmlSchema método .

El esquema XML se escribe mediante el estándar XSD.

Para escribir los datos en un documento XML, use el WriteXml método .

Las clases que derivan de la System.IO.TextWriter clase incluyen System.Web.HttpWriter, System.CodeDom.Compiler.IndentedTextWriter, System.Web.UI.HtmlTextWriter, System.IO.StreamWritery System.IO.StringWriter.

Consulte también

Se aplica a

WriteXmlSchema(String)

Source:
DataSet.cs
Source:
DataSet.cs
Source:
DataSet.cs

Escribe la estructura del DataSet como un esquema XML en un archivo.

public:
 void WriteXmlSchema(System::String ^ fileName);
public void WriteXmlSchema (string fileName);
member this.WriteXmlSchema : string -> unit
Public Sub WriteXmlSchema (fileName As String)

Parámetros

fileName
String

Nombre del archivo (incluida la ruta) en el que se va a escribir.

Excepciones

FileIOPermission no está establecido en Write.

Ejemplos

private void WriteSchemaToFile(DataSet thisDataSet)
{
    // Set the file path and name. Modify this for your purposes.
    string filename="Schema.xml";

    // Write the schema to the file.
    thisDataSet.WriteXmlSchema(filename);
}
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.
    thisDataSet.WriteXmlSchema(filename)
End Sub

Comentarios

Use el WriteXmlSchema método para escribir el esquema de en DataSet un documento XML. El esquema incluye definiciones de tabla, relación y restricción. Para escribir un esquema en un documento XML, use el WriteXmlSchema método .

El esquema XML se escribe mediante el estándar XSD.

Para escribir los datos en un documento XML, use el WriteXml método .

Consulte también

Se aplica a

WriteXmlSchema(XmlWriter)

Source:
DataSet.cs
Source:
DataSet.cs
Source:
DataSet.cs

Escribe la estructura del DataSet como un esquema XML en un objeto XmlWriter.

public:
 void WriteXmlSchema(System::Xml::XmlWriter ^ writer);
public void WriteXmlSchema (System.Xml.XmlWriter? writer);
public void WriteXmlSchema (System.Xml.XmlWriter writer);
member this.WriteXmlSchema : System.Xml.XmlWriter -> unit
Public Sub WriteXmlSchema (writer As XmlWriter)

Parámetros

writer
XmlWriter

XmlWriter en el que se va a escribir.

Ejemplos

En el ejemplo siguiente se crea un nuevo System.IO.FileStream objeto con la ruta de acceso especificada. El FileStream objeto se usa para crear un XmlTextWriter objeto . A WriteXmlSchema continuación, se invoca el método con el XmlTextWriter objeto para escribir el esquema en el disco.

private void WriteSchemaWithXmlTextWriter(DataSet thisDataSet)
{
    // Set the file path and name. Modify this for your purposes.
    string filename="SchemaDoc.xml";

    // Create a FileStream object with the file path and name.
    System.IO.FileStream stream = new System.IO.FileStream
        (filename,System.IO.FileMode.Create);

    // Create a new XmlTextWriter object with the FileStream.
    System.Xml.XmlTextWriter writer =
        new System.Xml.XmlTextWriter(stream,
        System.Text.Encoding.Unicode);

    // Write the schema into the DataSet and close the reader.
    thisDataSet.WriteXmlSchema(writer );
    writer.Close();
}
Private Sub WriteSchemaWithXmlTextWriter(thisDataSet As DataSet)
    ' Set the file path and name. Modify this for your purposes.
    Dim filename As String = "SchemaDoc.xml"

    ' Create a FileStream object with the file path and name.
    Dim stream As New System.IO.FileStream _
       (filename, System.IO.FileMode.Create)

    ' Create a new XmlTextWriter object with the FileStream.
    Dim writer As New System.Xml.XmlTextWriter _
       (stream, System.Text.Encoding.Unicode)

    ' Write the schema into the DataSet and close the reader.
    thisDataSet.WriteXmlSchema(writer)
    writer.Close()
End Sub

Comentarios

Use el WriteXmlSchema método para escribir el esquema de en DataSet un documento XML. El esquema incluye definiciones de tabla, relación y restricción. Para escribir un esquema en un documento XML, use el WriteXmlSchema método .

El esquema XML se escribe mediante el estándar XSD.

Para escribir los datos en un documento XML, use el WriteXml método .

Una clase que hereda de la System.Xml.XmlWriter clase es la XmlTextWriter clase .

Consulte también

Se aplica a

WriteXmlSchema(Stream, Converter<Type,String>)

Source:
DataSet.cs
Source:
DataSet.cs
Source:
DataSet.cs

Escribe la estructura DataSet como un esquema XML al objeto Stream especificado.

public:
 void WriteXmlSchema(System::IO::Stream ^ stream, Converter<Type ^, System::String ^> ^ multipleTargetConverter);
public void WriteXmlSchema (System.IO.Stream? stream, Converter<Type,string> multipleTargetConverter);
public void WriteXmlSchema (System.IO.Stream stream, Converter<Type,string> multipleTargetConverter);
member this.WriteXmlSchema : System.IO.Stream * Converter<Type, string> -> unit
Public Sub WriteXmlSchema (stream As Stream, multipleTargetConverter As Converter(Of Type, String))

Parámetros

stream
Stream

Un objeto Stream en el que se va a escribir.

multipleTargetConverter
Converter<Type,String>

Un delegado usado para convertir Type en una cadena.

Se aplica a

WriteXmlSchema(TextWriter, Converter<Type,String>)

Source:
DataSet.cs
Source:
DataSet.cs
Source:
DataSet.cs

Escribe la estructura de DataSet como un esquema XML en el objeto TextWriter especificado.

public:
 void WriteXmlSchema(System::IO::TextWriter ^ writer, Converter<Type ^, System::String ^> ^ multipleTargetConverter);
public void WriteXmlSchema (System.IO.TextWriter? writer, Converter<Type,string> multipleTargetConverter);
public void WriteXmlSchema (System.IO.TextWriter writer, Converter<Type,string> multipleTargetConverter);
member this.WriteXmlSchema : System.IO.TextWriter * Converter<Type, string> -> unit
Public Sub WriteXmlSchema (writer As TextWriter, multipleTargetConverter As Converter(Of Type, String))

Parámetros

writer
TextWriter

Un objeto TextWriter en el que se va a escribir.

multipleTargetConverter
Converter<Type,String>

Un delegado usado para convertir Type en una cadena.

Se aplica a

WriteXmlSchema(XmlWriter, Converter<Type,String>)

Source:
DataSet.cs
Source:
DataSet.cs
Source:
DataSet.cs

Escribe la estructura de DataSet como un esquema XML en el objeto XmlWriter especificado.

public:
 void WriteXmlSchema(System::Xml::XmlWriter ^ writer, Converter<Type ^, System::String ^> ^ multipleTargetConverter);
public void WriteXmlSchema (System.Xml.XmlWriter? writer, Converter<Type,string> multipleTargetConverter);
public void WriteXmlSchema (System.Xml.XmlWriter writer, Converter<Type,string> multipleTargetConverter);
member this.WriteXmlSchema : System.Xml.XmlWriter * Converter<Type, string> -> unit
Public Sub WriteXmlSchema (writer As XmlWriter, multipleTargetConverter As Converter(Of Type, String))

Parámetros

writer
XmlWriter

Un objeto XmlWriter en el que se va a escribir.

multipleTargetConverter
Converter<Type,String>

Un delegado usado para convertir Type en una cadena.

Se aplica a