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();
  Modified On Sep-18-2014 01:23:52 PM

Leave Comment