I am trying to connect to database using app.config instead of putting the connection settings in each form. Below are the coding that i used. It works in Microsoft Visual Studio 2003. However, it doesn't works in Microsoft Visual Studio 2005. It states that the System.Configuration is obsolete. Does anyone know why and how to solve the problem?
Thank you.
app.config
------------------------------------------------------------------------------------------------------
<?xml version="1.0" Üncoding="utf-8" ?>
<configuration>
<appSettings>
<add key = "constring" value="data source=Testing; initial catalog=Northwind; Integrated Security=SSPI" />
</appSettings>
</configuration>
Form
--------------------------------------------------------------------------
Using System.Configuration;
// Setup Connection
string constr = ConfigurationSettings.AppSettings["constring"].ToString();
SqlConnection conn = new SqlConnection(constr);