this is my common app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="BO"
connectionString="Data Source=MyServer;Initial Catalog=BO;User ID=WebUser;Password=xxxx"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
And I'm working on a library, class.cs. Here's the part of the code where I get the error.
public static SqlConnection getNewConnection()
{
string conection = ConfigurationManager.ConnectionStrings["BO"].ConnectionString.ToString();
conn = new SqlConnection(conection);
return conn;
}
Error 1 The name 'conn' does not exist in the current context
Any idea? I have not copied any other file that's being referenced to the same file. (some error I've read is common when it comes to "does not exist in the current context")