I have a problem about the connection strings at web.config
below is the connection string on my web.config
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=something\SQLEXPRESS; Initial Catalog=myDB; User Id=username; Password=password;" />
</connectionStrings>
that value I stored in a static class and which recorded perfectly
but when the process at the class of my data access layer class
executing the method it got the error
Object reference not set to an instance of an object.
when executing the
SqlConnection con = null;
con.ConnectionString = GetConnectionString();
the ConnectionString Method
public string GetConnectionString()
{
string connectionString = Config_Key.ConnectionString;
return connectionString;
}
it returns the exact value of connection string from web.config
I debugged those already
dunno whats wrong about it