Share via


ServerReport.GetDataSources Method (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.

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

Syntax

'Declaration
Public Function GetDataSources ( _
    <OutAttribute> ByRef allCredentialsSet As Boolean _
) As ReportDataSourceInfoCollection
'Usage
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
)
public ReportDataSourceInfoCollection GetDataSources (
    /** @attribute OutAttribute() */ /** @ref */ boolean allCredentialsSet
)
JScript does not support passing value-type arguments by reference.

Parameters

  • allCredentialsSet

Return Value

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 can prompt for credentials.

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

Reference

ServerReport Class
ServerReport Members
Microsoft.Reporting.WinForms Namespace