DataSet.WriteXmlSchema 메서드

정의

DataSet 구조를 XML 스키마로 씁니다.

오버로드

WriteXmlSchema(String, Converter<Type,String>)

DataSet 구조를 파일에 XML 스키마로 씁니다.

WriteXmlSchema(Stream)

DataSet 구조체를 지정된 Stream 개체에 XML 스키마로 씁니다.

WriteXmlSchema(TextWriter)

DataSet 구조체를 지정된 TextWriter 개체에 XML 스키마로 씁니다.

WriteXmlSchema(String)

DataSet 구조를 파일에 XML 스키마로 씁니다.

WriteXmlSchema(XmlWriter)

DataSet 구조를 XmlWriter 개체에 XML 스키마로 씁니다.

WriteXmlSchema(Stream, Converter<Type,String>)

DataSet 구조체를 지정된 Stream 개체에 XML 스키마로 씁니다.

WriteXmlSchema(TextWriter, Converter<Type,String>)

지정된 DataSetTextWriter 구조를 XML 스키마로 씁니다.

WriteXmlSchema(XmlWriter, Converter<Type,String>)

지정된 DataSetXmlWriter 구조를 XML 스키마로 씁니다.

WriteXmlSchema(String, Converter<Type,String>)

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

DataSet 구조를 파일에 XML 스키마로 씁니다.

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

매개 변수

fileName
String

쓸 파일의 이름입니다.

multipleTargetConverter
Converter<Type,String>

Type을 문자열로 변환하는 데 사용되는 대리자입니다.

적용 대상

WriteXmlSchema(Stream)

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

DataSet 구조체를 지정된 Stream 개체에 XML 스키마로 씁니다.

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)

매개 변수

stream
Stream

파일에 쓸 때 사용되는 Stream 개체입니다.

예제

다음 예제에서는 스키마를 디스크에 쓰기 위해 WriteXmlSchema 메서드에 전달되는 새 FileStream 개체를 만듭니다.

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

설명

메서드를 WriteXmlSchema 사용하여 에 대한 스키마를 DataSet XML 문서에 씁니다. 스키마에는 테이블, 관계 및 제약 조건 정의가 포함됩니다. XML 문서에 스키마를 쓰려면 메서드를 WriteXmlSchema 사용합니다.

XML 스키마는 XSD 표준을 사용하여 작성됩니다.

XML 문서에 데이터를 쓰려면 메서드를 WriteXml 사용합니다.

클래스에서 Stream 파생되는 클래스에는 , FileStream, MemoryStreamNetworkStream가 포함됩니다BufferedStream.

추가 정보

적용 대상

WriteXmlSchema(TextWriter)

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

DataSet 구조체를 지정된 TextWriter 개체에 XML 스키마로 씁니다.

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)

매개 변수

writer
TextWriter

쓰기에 사용할 TextWriter 개체입니다.

예제

다음 예제에서는 새 System.IO.StringWriterSystem.Text.StringBuilder 만드는 데 사용되는 개체를 만듭니다. 는 StringWriter 메서드에 WriteXmlSchema 전달되고 결과 문자열은 콘솔 창에 인쇄됩니다.

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

설명

메서드를 WriteXmlSchema 사용하여 에 대한 스키마를 DataSet XML 문서에 씁니다. 스키마에는 테이블, 관계 및 제약 조건 정의가 포함됩니다. XML 문서에 스키마를 쓰려면 메서드를 WriteXmlSchema 사용합니다.

XML 스키마는 XSD 표준을 사용하여 작성됩니다.

XML 문서에 데이터를 쓰려면 메서드를 WriteXml 사용합니다.

클래스에서 System.IO.TextWriter 파생된 클래스에는 , , System.CodeDom.Compiler.IndentedTextWriter, System.Web.UI.HtmlTextWriterSystem.IO.StreamWriterSystem.IO.StringWriter가 포함System.Web.HttpWriter됩니다.

추가 정보

적용 대상

WriteXmlSchema(String)

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

DataSet 구조를 파일에 XML 스키마로 씁니다.

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

매개 변수

fileName
String

쓸 대상 파일 이름(경로 포함)입니다.

예외

FileIOPermissionWrite로 설정되지 않은 경우

예제

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

설명

메서드를 WriteXmlSchema 사용하여 에 대한 스키마를 DataSet XML 문서에 씁니다. 스키마에는 테이블, 관계 및 제약 조건 정의가 포함됩니다. XML 문서에 스키마를 쓰려면 메서드를 WriteXmlSchema 사용합니다.

XML 스키마는 XSD 표준을 사용하여 작성됩니다.

XML 문서에 데이터를 쓰려면 메서드를 WriteXml 사용합니다.

추가 정보

적용 대상

WriteXmlSchema(XmlWriter)

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

DataSet 구조를 XmlWriter 개체에 XML 스키마로 씁니다.

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)

매개 변수

writer
XmlWriter

XmlWriter입니다.

예제

다음 예제에서는 지정된 경로를 사용하여 새 System.IO.FileStream 개체를 만듭니다. 개체는 FileStream 개체를 만드는 XmlTextWriter 데 사용됩니다. WriteXmlSchema 그런 다음 개체를 사용하여 메서드를 XmlTextWriter 호출하여 스키마를 디스크에 씁니다.

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

설명

메서드를 WriteXmlSchema 사용하여 에 대한 스키마를 DataSet XML 문서에 씁니다. 스키마에는 테이블, 관계 및 제약 조건 정의가 포함됩니다. XML 문서에 스키마를 쓰려면 메서드를 WriteXmlSchema 사용합니다.

XML 스키마는 XSD 표준을 사용하여 작성됩니다.

XML 문서에 데이터를 쓰려면 메서드를 WriteXml 사용합니다.

클래스에서 System.Xml.XmlWriter 상속되는 클래스 중 하나는 클래스입니다 XmlTextWriter .

추가 정보

적용 대상

WriteXmlSchema(Stream, Converter<Type,String>)

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

DataSet 구조체를 지정된 Stream 개체에 XML 스키마로 씁니다.

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

매개 변수

stream
Stream

Stream 개체입니다.

multipleTargetConverter
Converter<Type,String>

Type을 문자열로 변환하는 데 사용되는 대리자입니다.

적용 대상

WriteXmlSchema(TextWriter, Converter<Type,String>)

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

지정된 DataSetTextWriter 구조를 XML 스키마로 씁니다.

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

매개 변수

writer
TextWriter

TextWriter 개체입니다.

multipleTargetConverter
Converter<Type,String>

Type을 문자열로 변환하는 데 사용되는 대리자입니다.

적용 대상

WriteXmlSchema(XmlWriter, Converter<Type,String>)

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

지정된 DataSetXmlWriter 구조를 XML 스키마로 씁니다.

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

매개 변수

writer
XmlWriter

XmlWriter 개체입니다.

multipleTargetConverter
Converter<Type,String>

Type을 문자열로 변환하는 데 사용되는 대리자입니다.

적용 대상