T
Tony Johansson
I try to read app.config from my program by using the following code.
private SqlConnection GetSqlConnection()
{
ConnectionStringSettings settings =
ConfigurationManager.ConnectionStrings[BLACKJACK];
if (settings == null)
{
throw new ArgumentException(BLACKJACK + " was not found as
a connectionstring name");
}
SqlConnection sqlConnection = new SqlConnection();
sqlConnection.ConnectionString = settings.ConnectionString;
return sqlConnection;
}
The problem is that I read machine.config instead of app.config.
So my question is how do I do to make the program read app.config ?
//Tony
private SqlConnection GetSqlConnection()
{
ConnectionStringSettings settings =
ConfigurationManager.ConnectionStrings[BLACKJACK];
if (settings == null)
{
throw new ArgumentException(BLACKJACK + " was not found as
a connectionstring name");
}
SqlConnection sqlConnection = new SqlConnection();
sqlConnection.ConnectionString = settings.ConnectionString;
return sqlConnection;
}
The problem is that I read machine.config instead of app.config.
So my question is how do I do to make the program read app.config ?
//Tony