Store your Connection string in web.config's Connectionstring Setting Section
<connectionstrings>
<add name="connectionname" connectionstring="Data Source=.;Initial Catalog=Dbname;User ID=sa;Password=123456">
and access it in your Web Page like
string con= ConfigurationManager.AppSettings["connectionname"]
for more help
connection string