R
RAM
Hello,
I have written simple ASP.NET application with logging in. I need to
open ASPNETDB database to read some information which is not available
using class library (custom table).
I have written:
using (SqlConnection aspnetdb = new
SqlConnection(ConfigurationManager.ConnectionStrings["ASPNETDB"].ConnectionString))
{
aspnetdb.Open(); // here problem
...
}
In web.config I have:
<add name="ASPNETDB" connectionString="Data
Source=localhost;Initial catalog=MIMMagazynASPNETDB;Integrated
Security=True;User Instance=True"/>
The problem occurs on opening ASPNETDB:
aspnetdb.ServerVersion...Message is "Invalid operation. The connection
is closed."
aspnetdb.ServerVersion...StackTrace is
" at System.Data.SqlClient.SqlConnection.GetOpenConnection()\r\n
at System.Data.SqlClient.SqlConnection.get_ServerVersion()"
Please help.
/RAM/
PS. I really need to open ASPNETDB.
I have written simple ASP.NET application with logging in. I need to
open ASPNETDB database to read some information which is not available
using class library (custom table).
I have written:
using (SqlConnection aspnetdb = new
SqlConnection(ConfigurationManager.ConnectionStrings["ASPNETDB"].ConnectionString))
{
aspnetdb.Open(); // here problem
...
}
In web.config I have:
<add name="ASPNETDB" connectionString="Data
Source=localhost;Initial catalog=MIMMagazynASPNETDB;Integrated
Security=True;User Instance=True"/>
The problem occurs on opening ASPNETDB:
aspnetdb.ServerVersion...Message is "Invalid operation. The connection
is closed."
aspnetdb.ServerVersion...StackTrace is
" at System.Data.SqlClient.SqlConnection.GetOpenConnection()\r\n
at System.Data.SqlClient.SqlConnection.get_ServerVersion()"
Please help.
/RAM/
PS. I really need to open ASPNETDB.