DataConnection 클래스

각 데이터 연결 유형이 파생된 기본 클래스를 나타냅니다.

상속 계층 구조

System.Object
  Microsoft.Office.InfoPath.DataConnection
    

네임스페이스:  Microsoft.Office.InfoPath
어셈블리:  Microsoft.Office.InfoPath(Microsoft.Office.InfoPath.dll)

구문

‘선언
Public MustInherit Class DataConnection
‘사용 방법
Dim instance As DataConnection
public abstract class DataConnection

주의

각 데이터 연결을 사용하여 기본 데이터 원본 또는 보조 데이터 원본에 삽입된 데이터를 검색하거나 전송합니다.

기본 데이터 원본의 데이터를 검색하거나 전송하는 데 사용되는 데이터 연결은 다음 데이터 연결 개체 유형 중 하나에 해당합니다.

보조 데이터 원본의 데이터를 검색하는 데 사용되는 데이터 연결은 다음 데이터 연결 개체 유형 중 하나에 해당합니다.

데이터 전송에만 사용되는 데이터 연결은 다음 데이터 연결 개체 유형 중 하나에 해당합니다.

특정 데이터 연결 종류에 대한 DataConnection 개체에 액세스하려면 양식 서식 파일과 연결된 DataConnectionCollection 개체를 사용합니다. DataConnectionCollection 개체에 액세스하려면 XmlForm 클래스의 DataConnections 속성을 사용합니다.

DataConnectionCollection에서 반환되는 개체의 속성 또는 메서드를 사용하려면 멤버에 액세스하기 전에 먼저 사용 중인 데이터 연결 종류를 나타내는 형식으로 해당 개체를 캐스팅해야 합니다. 예를 들어 Access 또는 SQL Server 데이터베이스에서 데이터를 검색하는 데 사용할 데이터 연결을 나타내는 AdoQueryConnection 개체로 작업하려면 다음 예제와 같이 DataConnectionCollection에서 반환되는 개체를 캐스팅해야 합니다.

   // Get the Employees connection from the 
   // DataConnections collection.
   AdoQueryConnection myAdoQueryConnection =
      (AdoQueryConnection)(this.DataConnections["Employees"]);
   ' Get the Employees connection from the 
   ' DataConnections collection.
   Dim myAdoQueryConnection As AdoQueryConnection = _
      DirectCast(Me.DataConnections("Employees"), AdoQueryConnection)

데이터 연결 작업에 대한 자세한 내용은 방법: 외부 데이터 원본 액세스를 참조하십시오.

스레드 보안

이 형식의 모든 공용 static (Visual Basic의Shared ) 멤버는 스레드로부터 안전합니다. 모든 인스턴스 멤버는 스레드로부터 안전하지 않을 수도 있습니다.

참고 항목

참조

DataConnection 멤버

Microsoft.Office.InfoPath 네임스페이스

상속 계층 구조

System.Object
  Microsoft.Office.InfoPath.DataConnection
    Microsoft.Office.InfoPath.AdoQueryConnection
    Microsoft.Office.InfoPath.AdoSubmitConnection
    Microsoft.Office.InfoPath.BdcQueryConnection
    Microsoft.Office.InfoPath.BdcSubmitConnection
    Microsoft.Office.InfoPath.EmailSubmitConnection
    Microsoft.Office.InfoPath.FileQueryConnection
    Microsoft.Office.InfoPath.FileSubmitConnection
    Microsoft.Office.InfoPath.SharepointListQueryConnection
    Microsoft.Office.InfoPath.SharePointListRWQueryConnection
    Microsoft.Office.InfoPath.SharePointListRWSubmitConnection
    Microsoft.Office.InfoPath.SubmitToHostConnection
    Microsoft.Office.InfoPath.WebServiceConnection