ReportingService2010.TestConnectForDataSourceDefinition(DataSourceDefinition, String, String, String) ReportingService2010.TestConnectForDataSourceDefinition(DataSourceDefinition, String, String, String) Method

定义

测试数据源的连接。 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);
参数
DataSourceDefinition
DataSourceDefinition DataSourceDefinition

定义到数据源的连接的数据源定义。 The data source definition that defines the connection to the data source.

UserName
String String

要用于测试连接的用户名称。用户名输入凭据用于提示的数据源。 The user name to use to test the connection.UserName is used with data sources that prompt for credentials.

Password
String String

要用于测试连接的密码。密码输入凭据用于提示的数据源。 The password to use to test the connection.Password is used with data sources that prompt for credentials.

ConnectError
String String

一条详细的错误消息。 A detailed error message. 连接失败时会返回此消息。 The message is returned when the connection fails. 数据源提供程序提供详细消息。 The data source provider provides the detailed message.

返回

一个指示连接是否成功建立的布尔值。 A Boolean the indicates whether the connection completed successfully. 一个包含详细错误消息的字符串。 A string that contains a detailed error message. 作为输出参数,返回的字符串ConnectError The string is returned as the out parameter, ConnectError.

注解

下表显示了有关此操作的标头和权限信息。The table below shows header and permissions information on this operation.

SOAP 标头使用情况SOAP Header Usage (In) TrustedUserHeaderValue(In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue(Out) ServerInfoHeaderValue
纯模式所需的权限Native Mode Required Permissions ExecuteReportDefinition (系统)ExecuteReportDefinition (System)
SharePoint 模式所需的权限SharePoint Mode Required Permissions 需要的系统属性EnableLoadReportDefinition设置为 trueNeeds the system property EnableLoadReportDefinition set to true

执行报表定义的权限是必需的。Permission to execute the report definition is required.

适用于