Connection String

 Rate It (0)

The connection string specifies information about how to initialize a connection to a data store.

It contains keyword/value pairs. the first pair is always the Provider or Driver. The following pairs will correspond with the data required to initialize the provide / driver.

Some Example Keywords:

SQL ODBC: Server, Database, Uid (user), Pwd (password), Trusted_Connection, MARS_Connection (multiple active record sets), Encrypt, AttachDbFilename,

SQLOLEDB: Data Source, Initial Catalog (database to connect to), UserId, Password, Integrated Security, Failover Partner (for mirroring).

Some example connection strings:

SqlConnection (.NET) standard Security:

"Data Source=ServerAddress;Initial Catalog=DataBase;User Id=username;Password=password;"

ODBC - PostgreSQL driver:

"Driver={PostgreSQL};Server=IP address;Port=5432;Database=DataBase;Uid=username;Pwd=password;"

More example connection string:
http://www.connectionstrings.com/

Revision number 4, Tuesday, May 05, 2009 9:50:27 PM by rtpHarry

Comments

It is great resource for my junior team members, i like to share it with them. Nice job.

very good

Another good prcatice would be to encrypt the connection string when you go live with the website

Nice Job.

great

Good! It can be help out to the new developers.

Good reference listing!

its nice one.

Always define connection string inside the Web.Config file.

http://www.connectionstrings.com/ is really great site. you point the database it will give you connection string

Related Articles

accessdatasource

The AccessDataSource class is a data source control that works with Microsoft Access databases. Like its base class, SqlDataSource, the AccessDataSource control uses SQL queries to perform data retrieval. One of the unique characteristics of the AccessDataSource

Bind ListControl's DataValueField/TextField to multiple columns

Concept A very common question asked on the ASP.NET Forums is how to bind a ListControl's DataTextField or DataValueField to multiple Columns. The classic solutionto do thatis to make your field(s) in the "Select" like : "select 'n°'

How to Postback Asynchronously from inside a GridView

Concept With the rise of ASP.NET 2.0 AJAX Extensions 1.0, developers were fascinated by the great AJAX Server controls, but they missed that some of them might be harmful if they didn't really know how to usethem ina proper way. One example is when there

Shortcuts

Table of Contents

Top Wiki Contributors

(last 30 days)

  1. mbanavige (14)
  2. codehard (3)
  3. Babunareshnarra (2)
  4. Dungimon (1)
  5. cabhilash (1)
Microsoft Communities