again in the page we can use the following
codes in pages to access the connectionstring
of web.config file -
1.add first using System.Configuration;
2.then declare following in appropriate section-
public ConnectionStringSettingsCollection _connections
= ConfigurationManager.ConnectionStrings;
public SqlConnection _connection = new SqlConnection();
_connection.ConnectionString =
_connections["ConnectionStringName"].ConnectionString;
3.now initiate connection by the connectionstring -
SqlConnection conn = new MySql.Data.MySqlClient.MySqlConnection
(_connection.ConnectionString);