A connection string provides the information that a provider needs to communicate with a particular database. The Connection String includes parameters such as the name of the driver, Server name and Database name , as well as security information such as user name and password.
An ADO.NET Data Provider is a class that can communicate with a specific type of database or data store. Usually Data Providers use a connection string containing a collection of parameters to establish the connection with the database through applications. The .NET Framework provides mainly three data providers, they are
From the following section you can find different types of providers and its connection strings in detail.
Microsoft SQL Server
.NET DataProvider - Standard Connection
.NET DataProvider - Trusted Connection
.NET DataProvider - using IP Address
OleDb - Standard Connection
OleDb - Trusted Connection
ODBC - Standard Connection
ODBC - Trusted Connection
.NET DataProvider - MySQL Connector/Net
Specifying TCP port
ODBC Local(MyODBC Driver )
ODBC 3.51 Driver
.NET DataProvider from Microsoft
OleDb - Oracle Driver
OleDb - Microsoft Driver
OleDb with MS Jet
ODBC - Exclusive Use
Web.config and ConnectionString
You can store connection strings in the Web.config file and reference the configuration entries in data source controls. You can create connectionStrings element within the
You can access the connectionstring value at run time in your ASP.NET application as shown in the following example.
From the following links you can see how each dataprovider makes connection to the database from ASP.NET application.