DataSet.WriteXmlSchema DataSet.WriteXmlSchema DataSet.WriteXmlSchema DataSet.WriteXmlSchema Method

Definizione

Scrive la struttura dell'oggetto DataSet come schema XML.Writes the DataSet structure as an XML schema.

Overload

WriteXmlSchema(String, Converter<Type,String>) WriteXmlSchema(String, Converter<Type,String>) WriteXmlSchema(String, Converter<Type,String>) WriteXmlSchema(String, Converter<Type,String>)

Scrive la struttura dell'oggetto DataSet come schema XML in un file.Writes the DataSet structure as an XML schema to a file.

WriteXmlSchema(Stream) WriteXmlSchema(Stream) WriteXmlSchema(Stream)

Scrive la struttura DataSet come schema XML nell'oggetto Stream specificato.Writes the DataSet structure as an XML schema to the specified Stream object.

WriteXmlSchema(TextWriter) WriteXmlSchema(TextWriter) WriteXmlSchema(TextWriter) WriteXmlSchema(TextWriter)

Scrive la struttura DataSet come schema XML nell'oggetto TextWriter specificato.Writes the DataSet structure as an XML schema to the specified TextWriter object.

WriteXmlSchema(String) WriteXmlSchema(String) WriteXmlSchema(String) WriteXmlSchema(String)

Scrive la struttura dell'oggetto DataSet come schema XML in un file.Writes the DataSet structure as an XML schema to a file.

WriteXmlSchema(XmlWriter) WriteXmlSchema(XmlWriter) WriteXmlSchema(XmlWriter) WriteXmlSchema(XmlWriter)

Scrive la struttura dell'oggetto DataSet come schema XML in un oggetto XmlWriter.Writes the DataSet structure as an XML schema to an XmlWriter object.

WriteXmlSchema(Stream, Converter<Type,String>) WriteXmlSchema(Stream, Converter<Type,String>) WriteXmlSchema(Stream, Converter<Type,String>)

Scrive la struttura DataSet come schema XML nell'oggetto Stream specificato.Writes the DataSet structure as an XML schema to the specified Stream object.

WriteXmlSchema(TextWriter, Converter<Type,String>) WriteXmlSchema(TextWriter, Converter<Type,String>) WriteXmlSchema(TextWriter, Converter<Type,String>) WriteXmlSchema(TextWriter, Converter<Type,String>)

Scrive la struttura di DataSet come XML Schema nell'oggetto TextWriter specificato.Writes the DataSet structure as an XML schema to the specified TextWriter.

WriteXmlSchema(XmlWriter, Converter<Type,String>) WriteXmlSchema(XmlWriter, Converter<Type,String>) WriteXmlSchema(XmlWriter, Converter<Type,String>) WriteXmlSchema(XmlWriter, Converter<Type,String>)

Scrive la struttura di DataSet come XML Schema nell'oggetto XmlWriter specificato.Writes the DataSet structure as an XML schema to the specified XmlWriter.

WriteXmlSchema(String, Converter<Type,String>) WriteXmlSchema(String, Converter<Type,String>) WriteXmlSchema(String, Converter<Type,String>) WriteXmlSchema(String, Converter<Type,String>)

Scrive la struttura dell'oggetto DataSet come schema XML in un file.Writes the DataSet structure as an XML schema to a file.

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))

Parametri

fileName
String String String String

Nome del file in cui scrivere.The name of the file to write to.

multipleTargetConverter
Converter<Type,String>

Delegato utilizzato per convertire Type in stringa.A delegate used to convert Type to string.

WriteXmlSchema(Stream) WriteXmlSchema(Stream) WriteXmlSchema(Stream)

Scrive la struttura DataSet come schema XML nell'oggetto Stream specificato.Writes the DataSet structure as an XML schema to the specified Stream object.

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

Parametri

stream
Stream Stream Stream Stream

Oggetto Stream utilizzato per scrivere in un file.A Stream object used to write to a file.

Esempi

L'esempio seguente crea un nuovo FileStream oggetto che viene passato il WriteXmlSchema metodo per scrivere lo schema sul disco.The following example creates a new FileStream object that is passed to the WriteXmlSchema method to write the schema to disk.

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

Commenti

Usare la WriteXmlSchema metodo per scrivere lo schema per un DataSet a un documento XML.Use the WriteXmlSchema method to write the schema for a DataSet to an XML document. Lo schema include le definizioni di tabella, relazioni e vincoli.The schema includes table, relation, and constraint definitions. Per scrivere uno schema a un documento XML, usare il WriteXmlSchema (metodo).To write a schema to an XML document, use the WriteXmlSchema method.

Lo schema XML viene scritto usando lo standard XSD.The XML schema is written using the XSD standard.

Per scrivere i dati in un documento XML, usare il WriteXml (metodo).To write the data to an XML document, use the WriteXml method.

Le classi che derivano dal Stream classe includono BufferedStream, FileStream, MemoryStream, e NetworkStream.Classes that derive from the Stream class include BufferedStream, FileStream, MemoryStream, and NetworkStream.

Vedi anche

WriteXmlSchema(TextWriter) WriteXmlSchema(TextWriter) WriteXmlSchema(TextWriter) WriteXmlSchema(TextWriter)

Scrive la struttura DataSet come schema XML nell'oggetto TextWriter specificato.Writes the DataSet structure as an XML schema to the specified TextWriter object.

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)

Parametri

writer
TextWriter TextWriter TextWriter TextWriter

Oggetto TextWriter con cui eseguire operazioni di scrittura.The TextWriter object with which to write.

Esempi

L'esempio seguente crea una System.Text.StringBuilder oggetto a cui viene usato per creare un nuovo System.IO.StringWriter.The following example creates a System.Text.StringBuilder object to that is used to create a new System.IO.StringWriter. Il StringWriter viene passato per il WriteXmlSchema metodo e la stringa risultante viene stampato nella finestra della console.The StringWriter is passed to the WriteXmlSchema method, and the resulting string is printed to the console window.

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

Commenti

Usare la WriteXmlSchema metodo per scrivere lo schema per un DataSet a un documento XML.Use the WriteXmlSchema method to write the schema for a DataSet to an XML document. Lo schema include le definizioni di tabella, relazioni e vincoli.The schema includes table, relation, and constraint definitions. Per scrivere uno schema a un documento XML, usare il WriteXmlSchema (metodo).To write a schema to an XML document, use the WriteXmlSchema method.

Lo schema XML viene scritto usando lo standard XSD.The XML schema is written using the XSD standard.

Per scrivere i dati in un documento XML, usare il WriteXml (metodo).To write the data to an XML document, use the WriteXml method.

Le classi derivate dal System.IO.TextWriter classe includono i System.Web.HttpWriter, System.CodeDom.Compiler.IndentedTextWriter, System.Web.UI.HtmlTextWriter, System.IO.StreamWriter, e System.IO.StringWriter.Classes the derive from the System.IO.TextWriter class include the System.Web.HttpWriter, System.CodeDom.Compiler.IndentedTextWriter, System.Web.UI.HtmlTextWriter, System.IO.StreamWriter, and System.IO.StringWriter.

Vedi anche

WriteXmlSchema(String) WriteXmlSchema(String) WriteXmlSchema(String) WriteXmlSchema(String)

Scrive la struttura dell'oggetto DataSet come schema XML in un file.Writes the DataSet structure as an XML schema to a file.

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

Parametri

fileName
String String String String

Nome del file, incluso il percorso, in cui scrivere.The file name (including the path) to which to write.

Eccezioni

Esempi

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

Commenti

Usare la WriteXmlSchema metodo per scrivere lo schema per un DataSet a un documento XML.Use the WriteXmlSchema method to write the schema for a DataSet to an XML document. Lo schema include le definizioni di tabella, relazioni e vincoli.The schema includes table, relation, and constraint definitions. Per scrivere uno schema a un documento XML, usare il WriteXmlSchema (metodo).To write a schema to an XML document, use the WriteXmlSchema method.

Lo schema XML viene scritto usando lo standard XSD.The XML schema is written using the XSD standard.

Per scrivere i dati in un documento XML, usare il WriteXml (metodo).To write the data to an XML document, use the WriteXml method.

Sicurezza

FileIOPermission
per la lettura e scrittura di file.for reading and writing files. Enumerazione associata: FileIOPermissionAccessAssociated enumeration: FileIOPermissionAccess

Vedi anche

WriteXmlSchema(XmlWriter) WriteXmlSchema(XmlWriter) WriteXmlSchema(XmlWriter) WriteXmlSchema(XmlWriter)

Scrive la struttura dell'oggetto DataSet come schema XML in un oggetto XmlWriter.Writes the DataSet structure as an XML schema to an XmlWriter object.

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)

Parametri

writer
XmlWriter XmlWriter XmlWriter XmlWriter

XmlWriter in cui scrivere.The XmlWriter to write to.

Esempi

L'esempio seguente crea un nuovo System.IO.FileStream oggetto con il percorso specificato.The following example creates a new System.IO.FileStream object with the specified path. Il FileStream oggetto viene usato per creare un XmlTextWriter oggetto.The FileStream object is used to create an XmlTextWriter object. Il WriteXmlSchema metodo viene quindi richiamato con il XmlTextWriter oggetto da scrivere lo schema sul disco.The WriteXmlSchema method is then invoked with the XmlTextWriter object to write the schema to the disk.

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

Commenti

Usare la WriteXmlSchema metodo per scrivere lo schema per un DataSet a un documento XML.Use the WriteXmlSchema method to write the schema for a DataSet to an XML document. Lo schema include le definizioni di tabella, relazioni e vincoli.The schema includes table, relation, and constraint definitions. Per scrivere uno schema a un documento XML, usare il WriteXmlSchema (metodo).To write a schema to an XML document, use the WriteXmlSchema method.

Lo schema XML viene scritto usando lo standard XSD.The XML schema is written using the XSD standard.

Per scrivere i dati in un documento XML, usare il WriteXml (metodo).To write the data to an XML document, use the WriteXml method.

Una classe che eredita dal System.Xml.XmlWriter classe è il XmlTextWriter classe.One class that inherits from the System.Xml.XmlWriter class is the XmlTextWriter class.

Vedi anche

WriteXmlSchema(Stream, Converter<Type,String>) WriteXmlSchema(Stream, Converter<Type,String>) WriteXmlSchema(Stream, Converter<Type,String>)

Scrive la struttura DataSet come schema XML nell'oggetto Stream specificato.Writes the DataSet structure as an XML schema to the specified Stream object.

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

Parametri

stream
Stream Stream Stream Stream

Oggetto Stream in cui scrivere.A Stream object to write to.

multipleTargetConverter
Converter<Type,String>

Delegato utilizzato per convertire Type in stringa.A delegate used to convert Type to string.

WriteXmlSchema(TextWriter, Converter<Type,String>) WriteXmlSchema(TextWriter, Converter<Type,String>) WriteXmlSchema(TextWriter, Converter<Type,String>) WriteXmlSchema(TextWriter, Converter<Type,String>)

Scrive la struttura di DataSet come XML Schema nell'oggetto TextWriter specificato.Writes the DataSet structure as an XML schema to the specified TextWriter.

public:
 void WriteXmlSchema(System::IO::TextWriter ^ writer, Converter<Type ^, System::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))

Parametri

writer
TextWriter TextWriter TextWriter TextWriter

Oggetto TextWriter in cui scrivere.A TextWriter object to write to.

multipleTargetConverter
Converter<Type,String>

Delegato utilizzato per convertire Type in stringa.A delegate used to convert Type to string.

WriteXmlSchema(XmlWriter, Converter<Type,String>) WriteXmlSchema(XmlWriter, Converter<Type,String>) WriteXmlSchema(XmlWriter, Converter<Type,String>) WriteXmlSchema(XmlWriter, Converter<Type,String>)

Scrive la struttura di DataSet come XML Schema nell'oggetto XmlWriter specificato.Writes the DataSet structure as an XML schema to the specified XmlWriter.

public:
 void WriteXmlSchema(System::Xml::XmlWriter ^ writer, Converter<Type ^, System::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))

Parametri

writer
XmlWriter XmlWriter XmlWriter XmlWriter

Oggetto XmlWriter in cui scrivere.A XmlWriter object to write to.

multipleTargetConverter
Converter<Type,String>

Delegato utilizzato per convertire Type in stringa.A delegate used to convert Type to string.

Si applica a