SqlDataSourceEnumerator.GetDataSources メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > SqlDataSourceEnumerator.GetDataSources メソッドの意味・解説 

SqlDataSourceEnumerator.GetDataSources メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

参照できるすべての SQL Server 2000 インスタンスまたは SQL Server 2005 インスタンスに関する情報格納された DataTable を取得します

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

Public Overrides Function
 GetDataSources As DataTable
Dim instance As SqlDataSourceEnumerator
Dim returnValue As DataTable

returnValue = instance.GetDataSources
public override DataTable GetDataSources ()
public:
virtual DataTable^ GetDataSources () override
public DataTable GetDataSources ()
public override function GetDataSources ()
 : DataTable

戻り値
参照できる SQL Serverインスタンスに関する情報格納されDataTable返します

解説解説
使用例使用例

次のコンソール アプリケーションは、参照できる SQL Serverインスタンスに関する情報取得し、その情報コンソール ウィンドウ表示します

Imports System.Data.Sql

Module Module1
  Sub Main()
    ' Retrieve the enumerator instance and then the data.
    Dim instance As SqlDataSourceEnumerator
 = _
     SqlDataSourceEnumerator.Instance
    Dim table As System.Data.DataTable = instance.GetDataSources()

    ' Display the contents of the table.
    DisplayData(table)

    Console.WriteLine("Press any key to continue.")
    Console.ReadKey()
  End Sub

  Private Sub DisplayData(ByVal
 table As DataTable)
    For Each row As DataRow
 In table.Rows
      For Each col As DataColumn
 In table.Columns
        Console.WriteLine("{0} = {1}", col.ColumnName,
 row(col))
      Next
      Console.WriteLine("============================")
    Next
  End Sub
End Module
using System.Data.Sql;

class Program
{
  static void Main()
  {
    // Retrieve the enumerator instance and then the data.
    SqlDataSourceEnumerator instance =
      SqlDataSourceEnumerator.Instance;
    System.Data.DataTable table = instance.GetDataSources();

    // Display the contents of the table.
    DisplayData(table);

    Console.WriteLine("Press any key to continue.");
    Console.ReadKey();
  }

  private static void DisplayData(System.Data.DataTable
 table)
  {
    foreach (System.Data.DataRow row in table.Rows)
    {
      foreach (System.Data.DataColumn col in
 table.Columns)
      {
        Console.WriteLine("{0} = {1}", col.ColumnName, row[col]);
      }
      Console.WriteLine("============================");
    }
  }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
SqlDataSourceEnumerator クラス
SqlDataSourceEnumerator メンバ
System.Data.Sql 名前空間
その他の技術情報
SQL Serverインスタンス列挙



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

辞書ショートカット

すべての辞書の索引

SqlDataSourceEnumerator.GetDataSources メソッドのお隣キーワード
検索ランキング

   

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



SqlDataSourceEnumerator.GetDataSources メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS