다음을 통해 공유


ReportingService2005.SetDataSourceContents Method

Sets the contents of a data source.

네임스페이스: Microsoft.WSSUX.ReportingServicesWebService.RSManagementService2005
어셈블리: ReportService2005 (in reportingservice2005.dll)

구문

‘선언
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/SetDataSourceContents", RequestNamespace:="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace:="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use:=SoapBindingUse.Literal, ParameterStyle:=SoapParameterStyle.Wrapped)> _
<SoapHeaderAttribute("BatchHeaderValue")> _
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction:=SoapHeaderDirection.Out)> _
Public Sub SetDataSourceContents ( _
    DataSource As String, _
    Definition As DataSourceDefinition _
)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/SetDataSourceContents", RequestNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)] 
[SoapHeaderAttribute("BatchHeaderValue")] 
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction=SoapHeaderDirection.Out)] 
public void SetDataSourceContents (
    string DataSource,
    DataSourceDefinition Definition
)
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/SetDataSourceContents", RequestNamespace=L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace=L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use=SoapBindingUse::Literal, ParameterStyle=SoapParameterStyle::Wrapped)] 
[SoapHeaderAttribute(L"BatchHeaderValue")] 
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction=SoapHeaderDirection::Out)] 
public:
void SetDataSourceContents (
    String^ DataSource, 
    DataSourceDefinition^ Definition
)
/** @attribute SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/SetDataSourceContents", RequestNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped) */ 
/** @attribute SoapHeaderAttribute("BatchHeaderValue") */ 
/** @attribute SoapHeaderAttribute("ServerInfoHeaderValue", Direction=SoapHeaderDirection.Out) */ 
public void SetDataSourceContents (
    String DataSource, 
    DataSourceDefinition Definition
)
SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/SetDataSourceContents", RequestNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped) 
SoapHeaderAttribute("BatchHeaderValue") 
SoapHeaderAttribute("ServerInfoHeaderValue", Direction=SoapHeaderDirection.Out) 
public function SetDataSourceContents (
    DataSource : String, 
    Definition : DataSourceDefinition
)

매개 변수

  • DataSource
    The full path name of the data source.

주의

To remove properties that are part of the data source definition, set the values of those properties to null (Nothing in Visual Basic).

If you set the CredentialRetrieval property of the data source definition to Integrated or Prompt, do not supply values for UserName or Password. Doing so results in a SOAP exception with the error code rsInvalidElementCombination.

If you set the CredentialRetrieval property of the data source definition to Integrated or Store, any value you supply for the Prompt property is not saved.

With subscriptions, it may be necessary to store credentials in the report server database so that the subscriptions can run unattended.

Setting the ConnectionString property of the data source definition to null (Nothing in Visual Basic) results in a SOAP exception with the error code rsInvalidXML. If you do not want to supply a value for ConnectionString, set its value to an empty string ("").

To compile the following code example, you must reference the Reporting Services WSDL and import certain namespaces. For more information, see 코드 예제 컴파일 및 실행. The following example code uses the SetDataSourceContents method to set the data source definition for an existing data source named "AdventureWorks":

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 New DataSourceDefinition()
      definition.CredentialRetrieval = CredentialRetrievalEnum.Integrated
      definition.ConnectString = "data source=(local);initial catalog=AdventureWorks2000"
      definition.Enabled = True
      definition.EnabledSpecified = True
      definition.Extension = "SQL"
      definition.ImpersonateUser = False
      definition.ImpersonateUserSpecified = True
      definition.Prompt = Nothing
      definition.WindowsCredentials = False

      Try
         rs.SetDataSourceContents("/SampleReports/AdventureWorks", definition)

      Catch e As SoapException
         Console.WriteLine(e.Detail.OuterXml)
      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 = new DataSourceDefinition();
      definition.CredentialRetrieval = CredentialRetrievalEnum.Integrated;
      definition.ConnectString = "data source=(local);initial catalog=AdventureWorks2000";
      definition.Enabled = true;
      definition.EnabledSpecified = true;
      definition.Extension = "SQL";
      definition.ImpersonateUser = false;
      definition.ImpersonateUserSpecified = true;
      definition.Prompt = null;
      definition.WindowsCredentials = false;

      try
      {
         rs.SetDataSourceContents( "/SampleReports/AdventureWorks", definition );
      }

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

스레드 보안

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

플랫폼

개발 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

대상 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

ReportingService2005 Class
ReportingService2005 Members
Microsoft.WSSUX.ReportingServicesWebService.RSManagementService2005 Namespace