다음을 통해 공유


AdomdConnection 클래스

Represents a connection to a multidimensional data source.

상속 계층

System.Object
  System.MarshalByRefObject
    System.ComponentModel.Component
      Microsoft.AnalysisServices.AdomdClient.AdomdConnection

네임스페이스:  Microsoft.AnalysisServices.AdomdClient
어셈블리:  Microsoft.AnalysisServices.AdomdClient(Microsoft.AnalysisServices.AdomdClient.dll)

구문

‘선언
Public NotInheritable Class AdomdConnection _
    Inherits Component _
    Implements IDbConnection, IDisposable, ICloneable
‘사용 방법
Dim instance As AdomdConnection
public sealed class AdomdConnection : Component, 
    IDbConnection, IDisposable, ICloneable
public ref class AdomdConnection sealed : public Component, 
    IDbConnection, IDisposable, ICloneable
[<SealedAttribute>]
type AdomdConnection =  
    class 
        inherit Component 
        interface IDbConnection 
        interface IDisposable 
        interface ICloneable 
    end
public final class AdomdConnection extends Component implements IDbConnection, IDisposable, ICloneable

AdomdConnection 유형에서 다음 멤버를 표시합니다.

생성자

  이름 설명
공용 메서드 AdomdConnection() Initializes a new instance of the AdomdConnection class with default values.
공용 메서드 AdomdConnection(String) Initializes a new instance of the AdomdConnection class by using the specified connection string.
공용 메서드 AdomdConnection(AdomdConnection) Initializes a new instance of the AdomdConnection class by using values from a specified AdomdConnection class. The session identifier and command state are not the same.

맨 위로 이동

속성

  이름 설명
공용 속성 ClientVersion Gets the version of the ADOMD.NET client that implements the AdomdConnection.
공용 속성 ConnectionString Gets or sets the string that the AdomdConnection uses to open an analytical data source.
공용 속성 ConnectionTimeout Gets the time to wait for a connection to be established before the AdomdConnection stops trying to connect and generates an error.
공용 속성 Container (Component에서 상속됨)
공용 속성 Cubes Gets an instance of a CubeCollection that represents the collection of cubes contained by an analytical data source.
공용 속성 Database Gets the name of the database to be used after the AdomdConnection is open.
공용 속성 MiningModels Gets an instance of a MiningModelCollection that represents the collection of mining models that an analytical data source contains.
공용 속성 MiningServices Gets an instance of a MiningServiceCollection that represents the collection of mining services that an analytical data source contains.
공용 속성 MiningStructures Gets an instance of a MiningStructureCollection that represents the collection of mining structures that an analytical data source contains.
공용 속성 ProviderVersion Gets the version of the XML for Analysis provider that the AdomdConnection uses.
공용 속성 ServerVersion Gets the version of the server used that the AdomdConnection uses.
공용 속성 SessionID Gets or sets the string identifier of the session that the AdomdConnection opened with the server.
공용 속성 ShowHiddenObjects Gets or sets a value that indicates whether hidden objects are returned.
공용 속성 Site (Component에서 상속됨)
공용 속성 State Gets the current state of the AdomdConnection.

맨 위로 이동

메서드

  이름 설명
공용 메서드 BeginTransaction() Begins a new transaction.
공용 메서드 BeginTransaction(IsolationLevel) Begins a new transaction with the specified IsolationLevel enumeration value.
공용 메서드 ChangeDatabase Changes the current database of the open AdomdConnection.
공용 메서드 Clone Creates and returns an instance of an AdomdConnection based on the current AdomdConnection. Session ID and state are not cloned.
공용 메서드 Close() Closes the connection to the database and ends the session.
공용 메서드 Close(Boolean) Closes the connection to the database, indicating whether to end the session.
공용 메서드 CreateCommand Creates and returns an AdomdCommand that is associated with the AdomdConnection.
공용 메서드 CreateObjRef 보안에 중요합니다. (MarshalByRefObject에서 상속됨)
공용 메서드 Dispose (Component에서 상속됨)
공용 메서드 Equals (Object에서 상속됨)
공용 메서드 GetHashCode (Object에서 상속됨)
공용 메서드 GetLifetimeService 보안에 중요합니다. (MarshalByRefObject에서 상속됨)
공용 메서드 GetSchemaDataSet(Guid, array<Object[]) Returns schema information from a data source by using a Guid object to specify which schema information to return and by applying any specified restrictions to the information.
공용 메서드 GetSchemaDataSet(String, AdomdRestrictionCollection) Returns schema information from a data source by using a schema name to identify which schema to retrieve and by applying any specified restrictions to the information.
공용 메서드 GetSchemaDataSet(Guid, array<Object[], Boolean) Returns schema information from a data source by using a Guid object to identify the information, applying any specified restrictions on the information, and optionally throwing an exception when inline errors occur.
공용 메서드 GetSchemaDataSet(String, AdomdRestrictionCollection, Boolean) Returns schema information from a data source by using a schema name to identify the information, applying any specified restrictions to the information, and optionally throwing an exception when inline errors occur.
공용 메서드 GetSchemaDataSet(String, String, AdomdRestrictionCollection) Returns schema information from a data source by using a schema name and namespace to identify the information, and by applying any specified restrictions to the information.
공용 메서드 GetSchemaDataSet(String, String, AdomdRestrictionCollection, Boolean) Returns schema information from a data source by using a schema name and namespace to identify the information, applying any specified restrictions to the information, and, optionally throwing an exception when inline errors occur.
공용 메서드 GetType (Object에서 상속됨)
공용 메서드 InitializeLifetimeService 보안에 중요합니다. (MarshalByRefObject에서 상속됨)
공용 메서드 Open() Opens a connection with an analytical data source by using the settings specified in the ConnectionString property of the AdomdConnection.
공용 메서드 Open(String) 인프라입니다. Opens a connection with an analytical data source by using the specified path..
공용 메서드 RefreshMetadata Forces the connection to repopulate all metadata from the server.
공용 메서드 ToString (Component에서 상속됨)

맨 위로 이동

이벤트

  이름 설명
공용 이벤트 Disposed (Component에서 상속됨)

맨 위로 이동

명시적 인터페이스 구현

  이름 설명
명시적 인터페이스 구현전용 메서드 IDbConnection.BeginTransaction() Begins a database transaction.
명시적 인터페이스 구현전용 메서드 IDbConnection.BeginTransaction(IsolationLevel) Begins a database transaction with the specified isolation level value.
명시적 인터페이스 구현전용 메서드 ICloneable.Clone Creates and returns an instance of an AdomdConnection based on the current AdomdConnection. Session ID and state are not cloned.
명시적 인터페이스 구현전용 메서드 IDbConnection.CreateCommand Creates a new AdomdCommand associated with this connection and returns its IDbCommand object.

맨 위로 이동

주의

The AdomdConnection represents a connection with an analytical data source (for example, a connection to an instance of Microsoft SQL Server 2005 Analysis Services(SSAS)). Each connection is associated with an XML for Analysis session. If an AdomdConnection goes out of scope, the connection is not closed. To close the connection, you must explicitly call the Close or Dispose method of the AdomdConnection. If the Close or Dispose method is not called, the session associated with the AdomdConnection remains active and can be reused by another AdomdConnection. For more information about managing sessions, see ADOMD.NET에서 연결 및 세션 작업 and SessionID.

The following subroutine uses the given arguments to build a connection string that the subroutine uses to try to connect to a specified instance of Analysis Services and return an AdomdConnection:

Public Function Connect(Optional ByVal ServerID As String = "localhost", _
    Optional ByVal DatabaseID As String = "", _
    Optional ByVal UserID As String = "", _
    Optional ByVal Password As String = "") As AdomdConnection

    Dim strConnectionString As String
    Dim objConnection As AdomdConnection

    Try
        ' First, build the connection string.
        ' 
        ' The ConnectionString property consists of 
        
        ' key/value pairs seperated by semicolons.
        ' - The format, as a regular expression, should be:
        ' (<Key>=<Value>)*([[;]/*(<Key>=<Value>)])

        ' The connection string can take "Datasource", "Data Source", 
        ' or "Location" for this parameter.
        If ServerID <> "" Then
            strConnectionString &= "Data Source=" & ServerID & ";"
        End If

        ' The connection string can take "Catalog" or "Initial Catalog" 
        ' for this parameter.
        If DatabaseID <> "" Then
            strConnectionString &= "Initial Catalog=" & DatabaseID & ";"
        End If

        ' The connection string can take "UID", "User ID", 
        ' "Authenticated User", or "UserName" for this parameter.
        If UserID <> "" Then
            strConnectionString &= "User ID=" & UserID & ";"
        End If

        ' The connection string can take "PWD" or "Password" 
        ' for this parameter.
        If Password <> "" Then
            strConnectionString &= "Password=" & Password & ";"
        End If

        ' Get a reference to an AdomdConnection object.
        objConnection = New AdomdConnection()

        ' Assign the connection string and try to 
        ' open a connection.
        objConnection.ConnectionString = strConnectionString
        objConnection.Open()

        Catch ex As AdomdConnectionException
            ' The connection could not be opened or was disconnected.
            ' This error can occur at any time, if the provider is 
            ' disconnected from the server.
            Debug.WriteLine(ex)
        Catch ex As AdomdErrorResponseException
            ' A response is received from a provider that indicates an error.
            Debug.WriteLine(ex)
        Catch ex As AdomdUnknownResponseException
            ' A response has been returned from the provider that 
            ' was not understood.
            Debug.WriteLine(ex)
        Catch ex As AdomdCacheExpiredException
            ' A cached version of an ADOMD.NET object is no longer valid.
            ' This error is typically raised when reviewing metadata.
            Debug.WriteLine(ex)
        Catch ex As AdomdException
            ' Any other error raised by ADOMD.NET.
            Debug.WriteLine(ex)
        Catch ex As Exception
            ' Any other error that occurs.
            Debug.WriteLine(ex)
    Finally
        Debug.Write("The connection ")
        If objConnection.State = ConnectionState.Open Then
            Debug.WriteLine("is connected!")
        Else
            Debug.WriteLine("failed to connect!")
        End If
    End Try
    
    ' Return the AdomdConnection object.
    Return objConnection
End Function

스레드 보안

이 유형의 모든 공용 static(Visual Basic에서는 Shared) 멤버는 스레드로부터 안전합니다. 인스턴스 멤버는 스레드로부터의 안전성이 보장되지 않습니다.

참고 항목

참조

Microsoft.AnalysisServices.AdomdClient 네임스페이스