ReportingService2010.TestConnectForItemDataSource(String, String, String, String, String) ReportingService2010.TestConnectForItemDataSource(String, String, String, String, String) ReportingService2010.TestConnectForItemDataSource(String, String, String, String, String) Method

定义

测试数据源的连接。 Tests the connection for a data source. 此方法支持已发布的数据源的测试,这些数据源由报表或模型和共享数据源使用。 This method supports the testing of published data sources that are used by reports or models and shared data sources. 此方法适用于ReportModelDataset项类型。 This method applies to the Report, Model, and Dataset item types.

public:
 bool TestConnectForItemDataSource(System::String ^ ItemPath, System::String ^ DataSourceName, 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/TestConnectForItemDataSource", 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("ServerInfoHeaderValue", Direction=System.Web.Services.Protocols.SoapHeaderDirection.Out)]
[System.Web.Services.Protocols.SoapHeader("TrustedUserHeaderValue")]
public bool TestConnectForItemDataSource (string ItemPath, string DataSourceName, string UserName, string Password, out string ConnectError);
Public Function TestConnectForItemDataSource (ItemPath As String, DataSourceName As String, UserName As String, Password As String, ByRef ConnectError As String) As Boolean
参数
ItemPath
String String String

将项的完全限定的 URL DataSourceName适用,包括文件名称,并在 SharePoint 模式下,该扩展。 The fully qualified URL of the item to which the DataSourceName applies, including the file name and, in SharePoint mode, the extension. 该项可以是共享数据源、报表或报表模型。 The item can be a shared data source, a report, or a report model.

DataSourceName
String String String

项的数据源的名称。 The name of the data source for the item.

UserName
String String String

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

Password
String String String

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

ConnectError
String String String

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

返回

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

注解

下表显示了有关此操作的标头和权限信息。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 取决于项目类型:Depends on the item type:

- Report, DataSet: ReadDatasource- Report, DataSet: ReadDatasource
- Report 使用模型:ReadDatasource报表 ANDReadDatasource对模型- Report using a model: ReadDatasource on the report AND ReadDatasource on the model
- Report 使用共享的数据源:ReadDatasource报表 ANDReadContent共享的数据源- Report using a shared data source: ReadDatasource on the report AND ReadContent on the shared data source
- DataSource: ReadContent- DataSource: ReadContent
- Model: ReadDatasource- Model: ReadDatasource
SharePoint 模式所需的权限SharePoint Mode Required Permissions 取决于项目类型:Depends on the item type:

- Report``DataSet:OpenItemsItemPath- Report, DataSet: OpenItems on ItemPath
- Report 使用的模型或共享数据源:OpenItemsDataSourceName- Report using a model or a shared datasource: OpenItems on DataSourceName
- DataSource: OpenItems- DataSource: OpenItems
- Model: OpenItems- Model: OpenItems

如果DataSourceName指向 XML 数据源时,此方法不执行任何操作并返回trueIf DataSourceName points to an XML data source, this method does nothing and returns true.

适用于