0
I have a project of my own class library where I have my Context, in it I take the SQL connection that is in my web.config
.
How could I add the SQL connection so it stays inside the DLL? I want to pass the direct connection here without using web.config:
ConfigurationManager.ConnectionStrings["Conexao"].ConnectionString
I have it:
public Contexto()
{
minhaConexao = new SqlConnection(ConfigurationManager.ConnectionStrings["Conexao"].ConnectionString);
minhaConexao.Open();
}
You want to remove the use of
ConfigurationManager.ConnectionStrings["Conexao"].ConnectionString
. That?– Jéf Bueno
yes, I want to add connection inside the class so it won’t be visible on the web.config
– Harry