Share via


ServerReport.GetDataSources Method (Boolean)

 

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

Namespace:   Microsoft.Reporting.WinForms
Assembly:  Microsoft.ReportViewer.WinForms (in Microsoft.ReportViewer.WinForms.dll)

Syntax

public ReportDataSourceInfoCollection GetDataSources(
    out bool allCredentialsSet
)
public:
ReportDataSourceInfoCollection^ GetDataSources(
    [OutAttribute] bool% allCredentialsSet
)
member GetDataSources : 
        allCredentialsSet:bool byref -> ReportDataSourceInfoCollection
Public Function GetDataSources (
    <OutAttribute> ByRef allCredentialsSet As Boolean
) As ReportDataSourceInfoCollection

Parameters

  • allCredentialsSet
    Type: System.Boolean

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

Return Value

Type: Microsoft.Reporting.WinForms.ReportDataSourceInfoCollection

A ReportDataSourceInfoCollection containing ReportDataSourceInfo objects.

Remarks

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

Examples

Legacy Code Example

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);
   }
}

See Also

GetDataSources Overload
ServerReport Class
Microsoft.Reporting.WinForms Namespace

Return to top