.NET data providers are used for connecting to a RDBMS-specific database (such as SQL Server or Oracle), executing commands, and retrieving results. Those results are either processed directly (via a DataReader) or placed in an ADO.NET DataSet (via a DataAdapter) in order to be exposed to the user in an ad hoc manner, combined with data from multiple sources, or passed around between tiers. .NET data providers are designed to be lightweight, to create a minimal layer between the data source and the .NET programmer's code, and to increase performance while not sacrificing any functionality.
To connect to a specific data source, you use a data connection object. To connect to Microsoft SQL Server 7.0 or later, you need to use the SqlConnection object of the SQL Server .NET data provider. You need to use the OleDbConnection object of the OLE DB .NET data provider to connect to an OLE DB data source, or the OLE DB provider for SQL Server (SQLOLEDB) to connect to versions of Microsoft SQL Server earlier than 7.0.
For the OLE DB .NET data provider, the connection string format is the same as the connection string format used in ADO, with the following exceptions:
Here is an example OleDbConnection connection string connecting to an Access database:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source= "C:\Program ...