DataSet.WriteXmlSchema メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
DataSet構造体を XML スキーマとして書き込みます。
オーバーロード
| 名前 | 説明 |
|---|---|
| WriteXmlSchema(String, Converter<Type,String>) |
DataSet構造体を XML スキーマとしてファイルに書き込みます。 |
| WriteXmlSchema(Stream) | |
| WriteXmlSchema(TextWriter) |
DataSet構造体を XML スキーマとして、指定したTextWriter オブジェクトに書き込みます。 |
| WriteXmlSchema(String) |
DataSet構造体を XML スキーマとしてファイルに書き込みます。 |
| WriteXmlSchema(XmlWriter) | |
| WriteXmlSchema(Stream, Converter<Type,String>) | |
| WriteXmlSchema(TextWriter, Converter<Type,String>) |
DataSet構造体を XML スキーマとして、指定したTextWriterに書き込みます。 |
| WriteXmlSchema(XmlWriter, Converter<Type,String>) |
WriteXmlSchema(String, Converter<Type,String>)
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
書き込むファイルの名前。
適用対象
WriteXmlSchema(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)
パラメーター
例
次の例では、スキーマをディスクに書き込む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
注釈
DataSetのスキーマを XML ドキュメントに書き込むには、WriteXmlSchema メソッドを使用します。 スキーマには、テーブル、リレーションシップ、および制約の定義が含まれます。 XML ドキュメントにスキーマを書き込むには、 WriteXmlSchema メソッドを使用します。
XML スキーマは、XSD 標準を使用して記述されます。
XML ドキュメントにデータを書き込むには、 WriteXml メソッドを使用します。
Stream クラスから派生するクラスには、BufferedStream、FileStream、MemoryStream、およびNetworkStreamが含まれます。
こちらもご覧ください
適用対象
WriteXmlSchema(TextWriter)
DataSet構造体を XML スキーマとして、指定したTextWriter オブジェクトに書き込みます。
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.StringWriterの作成に使用するSystem.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
注釈
DataSetのスキーマを XML ドキュメントに書き込むには、WriteXmlSchema メソッドを使用します。 スキーマには、テーブル、リレーションシップ、および制約の定義が含まれます。 XML ドキュメントにスキーマを書き込むには、 WriteXmlSchema メソッドを使用します。
XML スキーマは、XSD 標準を使用して記述されます。
XML ドキュメントにデータを書き込むには、 WriteXml メソッドを使用します。
System.IO.TextWriter クラスから派生するクラスには、System.Web.HttpWriter、System.CodeDom.Compiler.IndentedTextWriter、System.Web.UI.HtmlTextWriter、System.IO.StreamWriter、およびSystem.IO.StringWriterが含まれます。
こちらもご覧ください
適用対象
WriteXmlSchema(String)
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
書き込むファイル名 (パスを含む)。
例外
FileIOPermission が Write に設定されていません。
例
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
注釈
DataSetのスキーマを XML ドキュメントに書き込むには、WriteXmlSchema メソッドを使用します。 スキーマには、テーブル、リレーションシップ、および制約の定義が含まれます。 XML ドキュメントにスキーマを書き込むには、 WriteXmlSchema メソッドを使用します。
XML スキーマは、XSD 標準を使用して記述されます。
XML ドキュメントにデータを書き込むには、 WriteXml メソッドを使用します。
こちらもご覧ください
適用対象
WriteXmlSchema(XmlWriter)
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)
パラメーター
例
次の例では、指定したパスを持つ新しい 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
注釈
DataSetのスキーマを XML ドキュメントに書き込むには、WriteXmlSchema メソッドを使用します。 スキーマには、テーブル、リレーションシップ、および制約の定義が含まれます。 XML ドキュメントにスキーマを書き込むには、 WriteXmlSchema メソッドを使用します。
XML スキーマは、XSD 標準を使用して記述されます。
XML ドキュメントにデータを書き込むには、 WriteXml メソッドを使用します。
System.Xml.XmlWriter クラスから継承するクラスの 1 つは、XmlTextWriter クラスです。
こちらもご覧ください
適用対象
WriteXmlSchema(Stream, Converter<Type,String>)
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
Public Sub WriteXmlSchema (stream As Stream, multipleTargetConverter As Converter(Of Type, String))
パラメーター
適用対象
WriteXmlSchema(TextWriter, Converter<Type,String>)
DataSet構造体を XML スキーマとして、指定した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))
パラメーター
- writer
- TextWriter
書き込む TextWriter オブジェクト。
適用対象
WriteXmlSchema(XmlWriter, Converter<Type,String>)
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))