ServerReport.GetDataSources 方法 (out Boolean)

Retrieves information about the data sources used for a report, including whether all required credentials have been supplied for the report data sources.

命名空间: Microsoft.Reporting.WebForms
程序集: Microsoft.ReportViewer.WebForms (在 microsoft.reportviewer.webforms.dll 中)

语法

声明
用法

参数

  • allCredentialsSet
    [out] Indicates whether all required credentials have been supplied for the data sources used by the server report.

返回值

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.

示例

The following example lists all data sources that prompt for credentials for the server report currently active in a ReportViewer control.

private void button1_Click(object sender, EventArgs e)
{
   bool bCreds;

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

   Debug.WriteLine("All credentials supplied: {0}", 
      bCreds.ToString());

   foreach (ReportDataSourceInfo rdsi in rdsic)
   {
      Debug.WriteLine(rdsi.Name + ":" + rdsi.Prompt);
   }
}

另请参见

参考

ServerReport 类
ServerReport 成员
Microsoft.Reporting.WebForms 命名空间