Share via


ServerReport.GetDataSources メソッド

レポートに使用するデータ ソースに関する情報を取得します。

名前空間:  Microsoft.Reporting.WinForms
アセンブリ:  Microsoft.ReportViewer.WinForms (Microsoft.ReportViewer.WinForms.dll)

構文

'宣言
Public Function GetDataSources As ReportDataSourceInfoCollection
'使用
Dim instance As ServerReport
Dim returnValue As ReportDataSourceInfoCollection

returnValue = instance.GetDataSources()
public ReportDataSourceInfoCollection GetDataSources()
public:
ReportDataSourceInfoCollection^ GetDataSources()
member GetDataSources : unit -> ReportDataSourceInfoCollection 
public function GetDataSources() : ReportDataSourceInfoCollection

戻り値

型: Microsoft.Reporting.WinForms.ReportDataSourceInfoCollection
ReportDataSourceInfo オブジェクトを含む ReportDataSourceInfoCollection

説明

このメソッドは、資格情報を要求するレポートで使用する、データ ソース名およびユーザー プロンプト文字列を返します。

使用例

private void button1_Click(object sender, EventArgs e)
{

   ReportDataSourceInfoCollection rdsic =
      this.reportViewer1.ServerReport.GetDataSources();

   foreach (ReportDataSourceInfo rdsi in rdsic)
   {
      Debug.WriteLine(rdsi.Name + ":" + rdsi.Prompt);
   }
}
Private Sub Button2_Click(ByVal sender As System.Object, _
   ByVal e As System.EventArgs) Handles Button2.Click
    Dim rdsic As ReportDataSourceInfoCollection = _
       ReportViewer1.ServerReport.GetDataSources

    For Each rdsi As ReportDataSourceInfo In rdsic
        Debug.WriteLine(rdsi.Name + ":" + rdsi.Prompt)
    Next

End Sub

関連項目

参照

ServerReport クラス

GetDataSources オーバーロード

Microsoft.Reporting.WinForms 名前空間