Steps to connect with Database…

Step 1. Create a connection string.
SqlConnection SqlCon=new SqlConnecyion(“Connectionstring”);

Step 2. Open the connection.


Step 3. Pass a query through command object

SqlCommand SqlCom;


SqlCom.CommandText=”sqlQuries” ;

Step 4. Read the using datareader.

SqlDatareader dr= SqlCom.ExcuteReader();
Step 5. Display the data using any display control.

Like DataGrid or GridView or DropDownBox Datalist etc

Step 6. Close the connection