次の方法で共有


DataSet.WriteXmlSchema メソッド (String)

DataSet 構造体を XML スキーマとしてファイルに書き込みます。

Overloads Public Sub WriteXmlSchema( _
   ByVal fileName As String _)
[C#]
public void WriteXmlSchema(stringfileName);
[C++]
public: void WriteXmlSchema(String* fileName);
[JScript]
public function WriteXmlSchema(
   fileName : String);

パラメータ

  • fileName
    書き込み先の (パスを含む) ファイル名。

例外

例外の種類 条件
SecurityException FileIOPermissionWrite に設定されていません。

解説

WriteXmlSchema メソッドを使用して、 DataSet のスキーマを XML ドキュメントに書き込みます。スキーマにはテーブル、リレーションシップ、制約の各定義が含まれています。XML ドキュメントにスキーマを書き込むには、 WriteXmlSchema メソッドを使用します。

XML スキーマの書き込みには、XSD 標準を使用します。

XML ドキュメントにデータを書き込むには、 WriteXml メソッドを使用します。

使用例

 
Private Sub WriteSchemaToFile(thisDataSet As DataSet)
    ' Set the file path and name. Modify this for your purposes.
    Dim filename As String = "mySchema.xml"
    ' Write the schema to the file.
    thisDataSet.WriteXmlSchema(filename)
End Sub

[C#] 
private void WriteSchemaToFile(DataSet thisDataSet){
   // Set the file path and name. Modify this for your purposes.
   string filename="mySchema.xml";
   // Write the schema to the file.
   thisDataSet.WriteXmlSchema(filename);
}

[C++] 
private:
 void WriteSchemaToFile(DataSet* thisDataSet){
    // Set the file path and name. Modify this for your purposes.
    String* filename=S"mySchema.xml";
    // Write the schema to the file.
    thisDataSet->WriteXmlSchema(filename);
 }

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET

.NET Framework セキュリティ:

参照

DataSet クラス | DataSet メンバ | System.Data 名前空間 | DataSet.WriteXmlSchema オーバーロードの一覧 | ReadXml | ReadXmlSchema | WriteXml