Exporter (0) Imprimer
Développer tout
Développer Réduire

Méthode GetDataSourceContents

Retourne le contenu d'une source de données.

Espace de noms :  ReportService2005
Assembly :  ReportService2005 (en ReportService2005.dll)

[SoapDocumentMethodAttribute("http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetDataSourceContents", RequestNamespace = "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
	ResponseNamespace = "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
	Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
public DataSourceDefinition GetDataSourceContents(
	string DataSource
)

Paramètres

DataSource
Type : System..::..String
Nom du chemin d'accès complet de la source de données.

Valeur de retour

Type : ReportService2005..::..DataSourceDefinition
Objet DataSourceDefinition qui contient les propriétés de connexion de la source de données.

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

SOAP Headers

(Out) ServerInfoHeaderValue

Required Permissions

ReadContent

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;

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

Ajouts de la communauté

AJOUTER
Afficher:
© 2014 Microsoft