Connection String

Connection stringis the very important part, we use connection string to connect to our database(Database like: MSSQL Server, Oracle, MSACESS etc).

A connectionstring is a string version of the initialization propertiesneeded to connect to a data store and enables us to easily store connectioninformation within our application or to pass it between applications.

Connection String may contain “ServerName”, “DatabaseName”, “UserID”,“Password”

For example:
SqlConnection con = new SqlConnection('server=XYZ\\sqlexpress; database=Hello; uid=sa;password=sa ');
Server Name = ”server=XYZ\\sqlexpress” Database = ”Hello” UserID  = ”sa”
Password =”sa”
//Openconnection   con.Open();
//Closeconnection   con.Close();
Last updated:9/18/2014 1:23:52 PM
Uttam Misra

Uttam Misra

More than 18 years of working experience in IT sector. We are here to serve you best.


Leave Comment