Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Provider Property

OleDbConnection.Provider Property

Gets the name of the OLE DB provider specified in the "Provider= " clause of the connection string.

Namespace:  System.Data.OleDb
Assembly:  System.Data (in System.Data.dll)

<BrowsableAttribute(True)> _
Public ReadOnly Property Provider As String

Property Value

Type: System.String
The name of the provider as specified in the "Provider= " clause of the connection string. The default value is an empty string.

The following example creates an OleDbConnection and displays some of its read-only properties.

Public Sub OpenConnection(ByVal connectionString As String)

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft