In your .cs code you can pull the value of any ConnectionString using the following concept (where “blah” is the name of your connectionString as defined in your web.config file).
cn = new SqlConnection(ConfigurationManager.ConnectionStrings["blah"].ToString());