TO read the connectionString at runtiome use the follwoing code:
String str=String.Empty;
str = ConfigurationManager.AppSettings["cc"].ToString();
where cc is the variable defined in web.config file for the user defined connection string. It is used like this:
<appsettings>
<add key="cc" value="server=servername;uid=username;pwd=password;initial catalog=databasename" />
</appsettings>