Share via


ReportingService2010.TestConnectForDataSourceDefinition Method

Definition

Tests the connection for a data source. This method supports the direct testing of the data source.

public:
 bool TestConnectForDataSourceDefinition(ReportService2010::DataSourceDefinition ^ DataSourceDefinition, System::String ^ UserName, System::String ^ Password, [Runtime::InteropServices::Out] System::String ^ % ConnectError);
[System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/TestConnectForDataSourceDefinition", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, RequestNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", ResponseNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", Use=System.Web.Services.Description.SoapBindingUse.Literal)]
[System.Web.Services.Protocols.SoapHeader("TrustedUserHeaderValue")]
[System.Web.Services.Protocols.SoapHeader("ServerInfoHeaderValue", Direction=System.Web.Services.Protocols.SoapHeaderDirection.Out)]
public bool TestConnectForDataSourceDefinition (ReportService2010.DataSourceDefinition DataSourceDefinition, string UserName, string Password, out string ConnectError);
[<System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/TestConnectForDataSourceDefinition", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, RequestNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", ResponseNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", Use=System.Web.Services.Description.SoapBindingUse.Literal)>]
[<System.Web.Services.Protocols.SoapHeader("TrustedUserHeaderValue")>]
[<System.Web.Services.Protocols.SoapHeader("ServerInfoHeaderValue", Direction=System.Web.Services.Protocols.SoapHeaderDirection.Out)>]
member this.TestConnectForDataSourceDefinition : ReportService2010.DataSourceDefinition * string * string * string -> bool
Public Function TestConnectForDataSourceDefinition (DataSourceDefinition As DataSourceDefinition, UserName As String, Password As String, ByRef ConnectError As String) As Boolean

Parameters

DataSourceDefinition
DataSourceDefinition

The data source definition that defines the connection to the data source.

UserName
String

The user name to use to test the connection.UserName is used with data sources that prompt for credentials.

Password
String

The password to use to test the connection.Password is used with data sources that prompt for credentials.

ConnectError
String

A detailed error message. The message is returned when the connection fails. The data source provider provides the detailed message.

Returns

A Boolean the indicates whether the connection completed successfully.

A string that contains a detailed error message. The string is returned as the out parameter, ConnectError.

Attributes

Remarks

The table below shows header and permissions information on this operation.

SOAP Header Usage (In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue
Native Mode Required Permissions ExecuteReportDefinition (System)
SharePoint Mode Required Permissions Needs the system property EnableLoadReportDefinition set to true

Permission to execute the report definition is required.

Applies to