Wednesday, May 28, 2008

SQl Databse connection in Asp.net

It is always difficult to create connection is asp.net .
i can give you few effective ways to put everything well.

1. open the "web.config" file with the editor and add the following lines.




Now you can change the things like.
servername
uid,password & database name as per your SQL configuration.

The main advantage of doing this is that, every time you will not need to declare the connection .
you can simple access the connection by following .

SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["Connectionstring"]);
//Do something

con.open();
con.close();

ASP

It is good to work in ASP.net with the back end of powerful C# code.
Here i am trying to help others and get help from others to do every thing easily .

So dont be hesitate to contact me @ gaurabchaterje@gmail.com.

Let's begin