DataSet.ReadXmlSchemaとは? わかりやすく解説

DataSet.ReadXmlSchema メソッド (String)

指定したファイルかDataSetXML スキーマ読み込みます。

名前空間: System.Data
アセンブリ: System.Data (system.data.dll 内)
構文構文

Public Sub ReadXmlSchema ( _
    fileName As String _
)
public void ReadXmlSchema (
    string fileName
)
public:
void ReadXmlSchema (
    String^ fileName
)
public void ReadXmlSchema (
    String fileName
)
public function ReadXmlSchema (
    fileName : String
)

パラメータ

fileName

読み込み元の (パスを含む) ファイル名

例外例外
例外種類条件

SecurityException

FileIOPermission が Read設定されていません。

解説解説
使用例使用例
Private Sub ReadSchemaFromFile()
    ' Create the DataSet to read the schema into.
    Dim thisDataSet As New
 DataSet()

    ' Set the file path and name. Modify this for your purposes.
    Dim filename As String
 = "Schema.xml"

    ' Invoke the ReadXmlSchema method with the file name.
    thisDataSet.ReadXmlSchema(filename)
End Sub
private void ReadSchemaFromFile(){
   // Create the DataSet to read the schema into.
   DataSet thisDataSet = new DataSet();

   // Set the file path and name. Modify this for your purposes.
   string filename="Schema.xml";

   // Invoke the ReadXmlSchema method with the file name.
   thisDataSet.ReadXmlSchema(filename);
}
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

DataSet.ReadXmlSchema メソッド (Stream)

指定した Stream から DataSetXML スキーマ読み込みます。

名前空間: System.Data
アセンブリ: System.Data (system.data.dll 内)
構文構文

Public Sub ReadXmlSchema ( _
    stream As Stream _
)
Dim instance As DataSet
Dim stream As Stream

instance.ReadXmlSchema(stream)
public void ReadXmlSchema (
    Stream stream
)
public:
void ReadXmlSchema (
    Stream^ stream
)
public void ReadXmlSchema (
    Stream stream
)
public function ReadXmlSchema (
    stream : Stream
)

パラメータ

stream

読み込み元の Stream

解説解説

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

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

通常ReadXmlSchema メソッドは、DataSet への格納使用する ReadXml メソッド呼び出し前に呼び出されます。

Stream クラス派生クラスには、BufferedStream、FileStream、MemoryStream、および NetworkStream が含まれます。

メモメモ

DataSetスキーマに、同じ名前空間で名前が同じであるが型が違う要素含まれている場合スキーマReadXmlSchemaDataSet読み込もうとすると、例外スローさます。この例外は、.NET Framework Version 1.0使用している場合発生しません。

使用例使用例

XML スキーマ読み込み使用する FileStream オブジェクト作成し、このオブジェクトReadXmlSchema メソッド呼び出す例を次に示します

Private Sub ReadSchemaFromFileStream(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, 
    ' and set to open the file
    Dim stream As New System.IO.FileStream
 _
        (filename, System.IO.FileMode.Open)

    ' Read the schema into the DataSet.
    thisDataSet.ReadXmlSchema(stream)

    ' Close the FileStream.
    stream.Close()
End Sub
private void ReadSchemaFromFileStream(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, 
    // and set to open the file.
    System.IO.FileStream stream = 
        new System.IO.FileStream(filename,System.IO.FileMode.Open);

    // Read the schema into the DataSet.
    thisDataSet.ReadXmlSchema(stream);

    // Close the FileStream.
    stream.Close();
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

DataSet.ReadXmlSchema メソッド (TextReader)

指定した TextReader から DataSetXML スキーマ読み込みます。

名前空間: System.Data
アセンブリ: System.Data (system.data.dll 内)
構文構文

Public Sub ReadXmlSchema ( _
    reader As TextReader _
)
Dim instance As DataSet
Dim reader As TextReader

instance.ReadXmlSchema(reader)
public void ReadXmlSchema (
    TextReader reader
)
public:
void ReadXmlSchema (
    TextReader^ reader
)
public void ReadXmlSchema (
    TextReader reader
)
public function ReadXmlSchema (
    reader : TextReader
)

パラメータ

reader

読み込み元の TextReader。

解説解説
使用例使用例

スキーマ読み込み使用する StreamReader オブジェクト作成し、このオブジェクトReadXmlSchema メソッド呼び出す例を次に示します

Private Sub ReadSchemaFromStreamReader()
    ' Create the DataSet to read the schema into.
    Dim thisDataSet As New
 DataSet()

    ' Set the file path and name. Modify this for your purposes.
    Dim filename As String
 = "Schema.xml"

    ' Create a StreamReader object with the file path and name.
    Dim readStream As New
 System.IO.StreamReader(filename)

    ' Invoke the ReadXmlSchema method with the StreamReader object.
    thisDataSet.ReadXmlSchema(readStream)

    ' Close the StreamReader
    readStream.Close()
End Sub
private void ReadSchemaFromStreamReader()
{
    // Create the DataSet to read the schema into.
    DataSet thisDataSet = new DataSet();

    // Set the file path and name. Modify this for your purposes.
    string filename="Schema.xml";

    // Create a StreamReader object with the file path and name.
    System.IO.StreamReader readStream = 
        new System.IO.StreamReader(filename);

    // Invoke the ReadXmlSchema method with the StreamReader object.
    thisDataSet.ReadXmlSchema(readStream);

    // Close the StreamReader
    readStream.Close();
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

DataSet.ReadXmlSchema メソッド (XmlReader)

指定した XmlReader から DataSetXML スキーマ読み込みます。

名前空間: System.Data
アセンブリ: System.Data (system.data.dll 内)
構文構文

解説解説

ReadXmlSchema メソッド使用してDataSetスキーマ作成しますスキーマにはテーブルリレーションシップ制約の各定義が含まれています。

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

通常ReadXmlSchema メソッドは、DataSet への格納使用する ReadXml メソッド呼び出し前に呼び出されます。

System.Xml.XmlReader クラス抽象クラスです。XmlReader から継承するクラスは System.Xml.XmlTextReader クラスです。

メモメモ

DataSetスキーマに、同じ名前空間で名前が同じであるが型が違う要素含まれている場合スキーマReadXmlSchemaDataSet読み込もうとすると、例外スローさます。この例外は、.NET Framework Version 1.0使用している場合発生しません。

使用例使用例

新しDataSet および System.IO.FileStream オブジェクト作成する例を次に示しますファイル パスファイル名作成した FileStream オブジェクト使用して引数として ReadXmlSchema メソッド渡される System.Xml.XmlTextReader作成します

Private Sub ReadSchemaFromXmlTextReader()
    ' Create the DataSet to read the schema into.
    Dim thisDataSet As New
 DataSet()

    ' Set the file path and name. Modify this for your purposes.
    Dim filename As String
 = "Schema.xml"

    ' Create a FileStream object with the file path and name.
    Dim stream As New System.IO.FileStream
 _
       (filename, System.IO.FileMode.Open)

    ' Create a new XmlTextReader object with the FileStream.
    Dim xmlReader As New
 System.Xml.XmlTextReader(stream)

    ' Read the schema into the DataSet and close the reader.
    thisDataSet.ReadXmlSchema(xmlReader)
    xmlReader.Close()
End Sub
private void ReadSchemaFromXmlTextReader()
{
    // Create the DataSet to read the schema into.
    DataSet thisDataSet = new DataSet();

    // Set the file path and name. Modify this for your purposes.
    string filename="Schema.xml";

    // Create a FileStream object with the file path and name.
    System.IO.FileStream stream = new System.IO.FileStream
        (filename,System.IO.FileMode.Open);

    // Create a new XmlTextReader object with the FileStream.
    System.Xml.XmlTextReader xmlReader= 
        new System.Xml.XmlTextReader(stream);

    // Read the schema into the DataSet and close the reader.
    thisDataSet.ReadXmlSchema(xmlReader);
    xmlReader.Close();
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

DataSet.ReadXmlSchema メソッド

ADO.NET での DataSet使用


このページでは「.NET Framework クラス ライブラリ リファレンス」からDataSet.ReadXmlSchemaを検索した結果を表示しています。
Weblioに収録されているすべての辞書からDataSet.ReadXmlSchemaを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からDataSet.ReadXmlSchema を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

カテゴリ一覧

すべての辞書の索引



Weblioのサービス

「DataSet.ReadXmlSchema」の関連用語





DataSet.ReadXmlSchemaのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DataSet.ReadXmlSchemaのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS