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

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: