ReportingService2005.GetDataSourceContents Method

Returns the contents of a data source.

Namespace:  ReportService2005
Assembly:  ReportService2005 (in ReportService2005.dll)

[SoapDocumentMethodAttribute("", RequestNamespace = "", 
	ResponseNamespace = "", 
	Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
public DataSourceDefinition GetDataSourceContents(
	string DataSource


Type: System.String
The full path name of the data source.

Return Value

Type: ReportService2005.DataSourceDefinition
A DataSourceDefinition object that contains the connection properties for the data source.

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

SOAP Headers

(Out) ServerInfoHeaderValue

Required Permissions


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. 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:

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;

         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() ); 

Community Additions