OleDbConnection.Provider OleDbConnection.Provider OleDbConnection.Provider OleDbConnection.Provider Property

정의

연결 문자열의 "Provider= " 절에 지정된 OLE DB 공급자 이름을 가져옵니다.Gets the name of the OLE DB provider specified in the "Provider= " clause of the connection string.

public:
 property System::String ^ Provider { System::String ^ get(); };
[System.ComponentModel.Browsable(true)]
[System.Data.DataSysDescription("OleDbConnection_Provider")]
public string Provider { get; }
member this.Provider : string
Public ReadOnly Property Provider As String

속성 값

연결 문자열의 "Provider= " 절에 지정된 공급자 이름입니다.The name of the provider as specified in the "Provider= " clause of the connection string. 기본값은 빈 문자열입니다.The default value is an empty string.

예제

다음 예제에서는 OleDbConnection 하 고 해당 읽기 전용 속성 중 일부를 표시 합니다.The following example creates an OleDbConnection and displays some of its read-only properties.

static void OpenConnection(string connectionString)
{
    using (OleDbConnection connection = new OleDbConnection(connectionString))
    {
        try
        {
            connection.Open();
            Console.WriteLine("ServerVersion: {0} \nProvider: {1}",
                connection.ServerVersion, connection.Provider);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
        // The connection is automatically closed when the
        // code exits the using block.
    }
}
Public Sub OpenConnection(ByVal connectionString As String)

    Using connection As New OleDbConnection(connectionString)
        Try
            connection.Open()
            Console.WriteLine("ServerVersion: {0} Provider: {1}", _
                connection.ServerVersion, connection.Provider)
        Catch ex As Exception
            Console.WriteLine(ex.Message)
        End Try
        ' The connection is automatically closed when the
        ' code exits the Using block.
    End Using
End Sub

적용 대상

추가 정보