次の方法で共有


ServerReport.GetDataSources メソッド ()

Retrieves information about the data sources used for a report.

名前空間: Microsoft.Reporting.WebForms
アセンブリ: Microsoft.ReportViewer.WebForms (microsoft.reportviewer.webforms.dll 内)

構文

'宣言
'使用

戻り値

A ReportDataSourceInfoCollection containing ReportDataSourceInfo objects.

解説

This method returns the data source names and user prompt strings of any data sources used in the report that can prompt for credentials.

private void button1_Click(object sender, EventArgs e)
{

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

   foreach (ReportDataSourceInfo rdsi in rdsic)
   {
      Debug.WriteLine(rdsi.Name + ":" + rdsi.);
   }
}
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 クラス
ServerReport メンバ
Microsoft.Reporting.WebForms 名前空間