Thursday 6 September 2012

0 sql connection string in asp.net

Friend here i am going to tell you how to make connection between sql server 2005 to asp.net.In dot net we can make connection by 2 method.The first method is create connection via wizard method and the second method is via coding (using  connection string).

Here i am going to tell you how to make connection between sql server 2005 and asp.net by via connection string.

First you have to open new project.

Go to CS file.

add namespace using system.data.sqlclint;

Now USE THIS CONNECTION STRING.

SqlConnection cn= new SqlConnection( your connection string);
cn.Open();  //open the connection
SqlCommand command= new SqlCommand( “your sql command”, cn); // passing qry
command.ExecuteNonQuery();
cn.close();

0 comments:

Post a Comment

 

Coding Authority Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates