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)

'Declaration
<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)
        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

.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
Show:
© 2015 Microsoft