Net-informations.com
SiteMap  | About    

Connection String



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 DSN

ODBC - Standard Connection

ODBC - Trusted Connection

MySql

.NET DataProvider - MySQL Connector/Net

Specifying TCP port

OleDb

ODBC DSN

ODBC Local(MyODBC Driver )

ODBC 3.51 Driver

Oracle

.NET DataProvider from Microsoft

OleDb - Oracle Driver

OleDb - Microsoft Driver

Microsoft Access

OleDb with MS Jet

ODBC DSN

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 Element element, by create a child element named and place your connection strings there.

You can access the connectionstring value at run time in your ASP.NET application as shown in the following example.

VB.Net

C#

From the following links you can see how each dataprovider makes connection to the database from ASP.NET application.

ASP.NET SQL Server Connection

ASP.NET OLEDB Connection

ASP.NET ODBC Connection








net-informations.com (C) 2019    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.