DataSet.WriteXmlSchema メソッド (TextWriter)
アセンブリ: System.Data (system.data.dll 内)
構文Public Sub WriteXmlSchema ( _ writer As TextWriter _ )
public void WriteXmlSchema ( TextWriter writer )
public: void WriteXmlSchema ( TextWriter^ writer )
public void WriteXmlSchema ( TextWriter writer )
public function WriteXmlSchema ( writer : TextWriter )
解説WriteXmlSchema メソッドを使用して、DataSet のスキーマを XML ドキュメントに書き込みます。スキーマにはテーブル、リレーションシップ、制約の各定義が含まれています。XML ドキュメントにスキーマを書き込むには、WriteXmlSchema メソッドを使用します。
XML ドキュメントにデータを書き込むには、WriteXml メソッドを使用します。
System.IO.TextWriter クラスの派生クラスには、System.Web.HttpWriter、System.CodeDOM.Compiler.IndentedTextWriter、System.Web.UI.HtmlTextWriter、System.IO.StreamWriter、および System.IO.StringWriter が含まれます。
使用例新しい System.IO.StringWriter の作成に使用される System.Text.StringBuilder オブジェクトを作成する例を次に示します。StringWriter が WriteXmlSchema メソッドに渡され、結果の文字列がコンソール ウィンドウに出力されます。
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
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()); }
プラットフォームWindows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照DataSet.WriteXmlSchema メソッド (XmlWriter)
アセンブリ: System.Data (system.data.dll 内)
構文
解説WriteXmlSchema メソッドを使用して、DataSet のスキーマを XML ドキュメントに書き込みます。スキーマにはテーブル、リレーションシップ、制約の各定義が含まれています。XML ドキュメントにスキーマを書き込むには、WriteXmlSchema メソッドを使用します。
XML ドキュメントにデータを書き込むには、WriteXml メソッドを使用します。
System.Xml.XmlWriter クラスから継承するクラスには System.Xml.XmlTextWriter クラスがあります。
使用例指定したパスで新しい System.IO.FileStream オブジェクトを作成する例を次に示します。FileStream オブジェクトを使用して System.Xml.XMLTextWriter オブジェクトを作成します。次に、XmlTextWriter オブジェクトで WriteXmlSchema メソッドを呼び出して、ディスクにスキーマを書き込みます。
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
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(); }
プラットフォームWindows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照DataSet.WriteXmlSchema メソッド (Stream)
アセンブリ: System.Data (system.data.dll 内)
構文
解説WriteXmlSchema メソッドを使用して、DataSet のスキーマを XML ドキュメントに書き込みます。スキーマにはテーブル、リレーションシップ、制約の各定義が含まれています。XML ドキュメントにスキーマを書き込むには、WriteXmlSchema メソッドを使用します。
XML ドキュメントにデータを書き込むには、WriteXml メソッドを使用します。
Stream クラスの派生クラスには、BufferedStream、FileStream、MemoryStream、および NetworkStream が含まれます。
使用例WriteXmlSchema メソッドに渡してスキーマをディスクに書き込むための新しい FileStream オブジェクトを作成する例を次に示します。
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
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(); }
プラットフォームWindows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照DataSet.WriteXmlSchema メソッド
オーバーロードの一覧| 名前 | 説明 | 
|---|---|
| DataSet.WriteXmlSchema (Stream) | 指定した System.IO.Stream オブジェクトを使用して、DataSet 構造体を XML スキーマとして書き込みます。 .NET Compact Framework によってサポートされています。 | 
| DataSet.WriteXmlSchema (String) | DataSet 構造体を XML スキーマとしてファイルに書き込みます。 .NET Compact Framework によってサポートされています。 | 
| DataSet.WriteXmlSchema (TextWriter) | DataSet 構造体を XML スキーマとして TextWriter オブジェクトに書き込みます。 .NET Compact Framework によってサポートされています。 | 
| DataSet.WriteXmlSchema (XmlWriter) | DataSet 構造体を XML スキーマとして XmlWriter オブジェクトに書き込みます。 .NET Compact Framework によってサポートされています。 | 
参照DataSet.WriteXmlSchema メソッド (String)
アセンブリ: System.Data (system.data.dll 内)
構文
例外
解説WriteXmlSchema メソッドを使用して、DataSet のスキーマを XML ドキュメントに書き込みます。スキーマにはテーブル、リレーションシップ、制約の各定義が含まれています。XML ドキュメントにスキーマを書き込むには、WriteXmlSchema メソッドを使用します。
使用例
.NET Framework のセキュリティ
プラットフォームWindows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照