hi, i suggest for your purpose to store the connection string in the wefconfig file like this:
<appSettings>
<add key= "sqlconnection" value= "YOUR CONNECTION STRING HERE"></add>
</appSettings>
it is recommended to have one connection per page, so you have to give the connection string property to your connection in some way like this:
SqlConnection myConn = new SqlConnection (ConfigurationSettings.AppSettings["sqlconnection"]);
hope it helps...
|