共用方式為


ServerReport.GetDataSources 方法 (Boolean%)

擷取報表所用之資料來源的相關資訊,其中包括是否提供了報表資料來源的所有必要認證。

命名空間:  Microsoft.Reporting.WebForms
組件:  Microsoft.ReportViewer.WebForms (在 Microsoft.ReportViewer.WebForms.dll 中)

語法

'宣告
Public Function GetDataSources ( _
    <OutAttribute> ByRef allCredentialsSet As Boolean _
) As ReportDataSourceInfoCollection
'用途
Dim instance As ServerReport
Dim allCredentialsSet As Boolean
Dim returnValue As ReportDataSourceInfoCollection

returnValue = instance.GetDataSources(allCredentialsSet)
public ReportDataSourceInfoCollection GetDataSources(
    out bool allCredentialsSet
)
public:
ReportDataSourceInfoCollection^ GetDataSources(
    [OutAttribute] bool% allCredentialsSet
)
member GetDataSources : 
        allCredentialsSet:bool byref -> ReportDataSourceInfoCollection 
public function GetDataSources(
    allCredentialsSet : boolean
) : ReportDataSourceInfoCollection

參數

  • allCredentialsSet
    型別:System.Boolean%
    [out] 指出是否提供了伺服器報表所用之資料來源的所有必要認證。

傳回值

型別:Microsoft.Reporting.WebForms.ReportDataSourceInfoCollection
包含 ReportDataSourceInfo 物件的 ReportDataSourceInfoCollection

備註

這個方法會傳回任何資料來源之資料來源名稱和使用者提示字串,這些資料來源用於設定為可提示認證的報表。

範例

下列範例會列出提示目前在 ReportViewer 控制項內使用中之報表伺服器認證的所有資料來源。

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 類別

GetDataSources 多載

Microsoft.Reporting.WebForms 命名空間