System.Data.OleDb Namespace OleDbConnection Class
Returns the name of the OLE DB provider.
Script |
[ string variable = ] OleDbConnection.Provider |
variable |
Returns the name of the provider as specified in the "Provider" clause of the connection string. |
The property is read only with no default value.
NOTE: You can change the value for this property only by setting the associated keyword in the ConnectionString property.
The following example illustrates several possible providers to use when setting the connection string.
Provider=MSDAORA; Data Source=ORACLE8i7; User ID=OLEDB; Password=OLEDB
Provider=SQLOLEDB; Data Source=myServer; Integrated Security=SSPI;
Provider=Microsoft.ACE.OLEDB.12.0; Data Source=myData.mdb;
The following example shows the simplest way to retrieve and display the Provider property of the current connection.
"Provider: " + myConn.Provider;
"Provider: " + myConn.Provider |
|
C# |
VB |
Show me
OleDbConnection Members ConnectionString