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();

No comments:
Post a Comment