ReportingService2005.GetDataSourceContents(String) Method

Definition

返回数据源的内容。Returns the contents of a data source.

public:
 ReportService2005::DataSourceDefinition ^ GetDataSourceContents(System::String ^ DataSource);
public ReportService2005.DataSourceDefinition GetDataSourceContents (string DataSource);
member this.GetDataSourceContents : string -> ReportService2005.DataSourceDefinition
Public Function GetDataSourceContents (DataSource As String) As DataSourceDefinition

Parameters

DataSource
String

数据源的完整路径名。The full path name of the data source.

Returns

DataSourceDefinition

一个包含数据源的连接属性的 DataSourceDefinition 对象。A DataSourceDefinition object that contains the connection properties for the data source. 密码字段不是从服务器检索的并且 DataSourceDefinition 对象的这个属性始终设置为 null。The Password field is not retrieved from the server and this property of the DataSourceDefinition object is always set to null.

Examples

若要编译此代码示例,必须引用 Reporting Services WSDL 并导入某些命名空间。To compile this code example, you must reference the Reporting Services WSDL and import certain namespaces. 有关详细信息,请参阅 编译和运行代码示例For more information, see Compiling and Running Code Examples. 下面的代码示例使用 GetDataSourceContents 方法检索共享数据源的数据源定义,然后将连接字符串和扩展名称显示为控制台输出:The following code example uses the GetDataSourceContents method to retrieve the data source definition of a shared data source and then displays the connection string and extension name as console output:

Imports System  
Imports System.Web.Services.Protocols  

Class Sample  
   Public Shared Sub Main()  
      Dim rs As New ReportingService2005()  
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials  

      Dim definition As DataSourceDefinition = Nothing  

      Try  
         definition = rs.GetDataSourceContents("/SampleReports/AdventureWorks")  
         Console.WriteLine("Connection String: {0}", definition.ConnectString)  
         Console.WriteLine("Extension name: {0}", definition.Extension)  

      Catch e As SoapException  
         Console.WriteLine(e.Detail.InnerXml.ToString())  
      End Try  
   End Sub 'Main  
End Class 'Sample  
using System;  
using System.Web.Services.Protocols;  

class Sample  
{  
   public static void Main()  
   {  
      ReportingService2005 rs = new ReportingService2005();  
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials;  

      DataSourceDefinition definition = null;  

      try  
      {  
         definition = rs.GetDataSourceContents( "/SampleReports/AdventureWorks" );  
         Console.WriteLine( "Connection String: {0}", definition.ConnectString );  
         Console.WriteLine( "Extension name: {0}", definition.Extension );  
      }  

      catch ( SoapException e )  
      {  
         Console.WriteLine( e.Detail.InnerXml.ToString() );   
      }  
   }  
}  

Remarks

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

SOAP 标头SOAP Headers (Out) ServerInfoHeaderValue(Out) ServerInfoHeaderValue
所需的权限Required Permissions ReadContent

Applies to