TestConnectForItemDataSource 方法
測試資料來源的連接。這個方法支援報表或模型及共用資料來源所使用已發行資料來源的測試。這個方法會套用至 Report、Model 和 Dataset 項目類型。
命名空間: ReportService2010
組件: ReportService2010 (在 ReportService2010.dll 中)
語法
'宣告
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/TestConnectForItemDataSource", RequestNamespace := "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", _
ResponseNamespace := "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction := SoapHeaderDirection.Out)> _
<SoapHeaderAttribute("TrustedUserHeaderValue")> _
Public Function TestConnectForItemDataSource ( _
ItemPath As String, _
DataSourceName As String, _
UserName As String, _
Password As String, _
<OutAttribute> ByRef ConnectError As String _
) As Boolean
'用途
Dim instance As ReportingService2010
Dim ItemPath As String
Dim DataSourceName As String
Dim UserName As String
Dim Password As String
Dim ConnectError As String
Dim returnValue As Boolean
returnValue = instance.TestConnectForItemDataSource(ItemPath, _
DataSourceName, UserName, Password, _
ConnectError)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/TestConnectForItemDataSource", RequestNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",
ResponseNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
[SoapHeaderAttribute("TrustedUserHeaderValue")]
public bool TestConnectForItemDataSource(
string ItemPath,
string DataSourceName,
string UserName,
string Password,
out string ConnectError
)
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/TestConnectForItemDataSource", RequestNamespace = L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",
ResponseNamespace = L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",
Use = SoapBindingUse::Literal, ParameterStyle = SoapParameterStyle::Wrapped)]
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction = SoapHeaderDirection::Out)]
[SoapHeaderAttribute(L"TrustedUserHeaderValue")]
public:
bool TestConnectForItemDataSource(
String^ ItemPath,
String^ DataSourceName,
String^ UserName,
String^ Password,
[OutAttribute] String^% ConnectError
)
[<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/TestConnectForItemDataSource", RequestNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",
ResponseNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)>]
[<SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)>]
[<SoapHeaderAttribute("TrustedUserHeaderValue")>]
member TestConnectForItemDataSource :
ItemPath:string *
DataSourceName:string *
UserName:string *
Password:string *
ConnectError:string byref -> bool
public function TestConnectForItemDataSource(
ItemPath : String,
DataSourceName : String,
UserName : String,
Password : String,
ConnectError : String
) : boolean
參數
- ItemPath
型別:System. . :: . .String
DataSourceName 套用至項目的完整 URL,包括檔案名稱以及 SharePoint 模式中的延伸模組。此項目可以是共用資料來源、報表或報表模型。
- DataSourceName
型別:System. . :: . .String
項目的資料來源名稱。
- UserName
型別:System. . :: . .String
用來測試連接的使用者名稱。UserName 是搭配提示輸入認證的資料來源使用。
- Password
型別:System. . :: . .String
用來測試連接的密碼。Password 是搭配提示輸入認證的資料來源使用。
- ConnectError
型別:System. . :: . .String%
詳細的錯誤訊息。連接失敗時會傳回此訊息。來源資料提供者會提供詳細的訊息。
傳回值
型別:System. . :: . .Boolean
包含詳細錯誤訊息的字串。此字串是以 out 參數 ConnectError 傳回。
指出連接是否已順利完成的 Boolean。
備註
The table below shows header and permissions information on this operation.
SOAP Header Usage |
(Out) ServerInfoHeaderValue |
Native Mode Required Permissions |
Depends on the item type:
|
SharePoint Mode Required Permissions |
Depends on the item type:
|
If DataSourceName points to an XML data source, this method does nothing and returns true.