Configuring an OLEDB Connection String
The .NET Framework data provider for OLE DB connects to an OLE DB data sources through the OleDbConnection object. The OLE DB provider connection string is specified using the ConnectionString property of the OleDbConnection object. This property specifies all settings needed to establish the connection to the data source and matches the OLE DB connection string format with an added Provider key-value pair specifying the OLE DB provider is required.
OLEDB Connection String Keywords :
- Data Source : The name of the database or physical location of the database file.
- File Name : The physical
location of a file that contains the real connection string.
- Persist Security Info: If set to true, retrieving the connection string returns the complete connection string that was originally provided. If set to false, the connection string will contain the information that was originally provided, minus the security information.
- Provider: The vendor-specific driver to use for connecting to the data store.
Following example shows how to access a data source using an OLE DB provider
|
Output :

The following providers have been tested with ADO.NET.
|
Driver |
Provider |
|
SQLOLEDB |
Microsoft OLE DB provider for SQL Server |
|
MSDAORA |
Microsoft OLE DB provider for Oracle |
|
Microsoft.Jet.OLEDB.4.0 |
OLE DB provider for Microsoft Jet |

Join the conversation! Your thoughts help the community grow.