V
Vitoman
Our department is currenly testing a web application that utilizes the
Entity Framework. After installing the application on IIS it works as
expected with one user but as soon as 2 people start working the same
application with different login information the following error appears :
ExecuteReader requires an open and available Connection. The connection's
current state is closed.
I am NOT explicitly opening or closing the database connection whe creating
the context object. I am using the "Using context/End Using" configuration
when I am accessing the entities.
Here is how I am setting up my EntityConnection string
Dim sqlBuilder As SqlConnectionStringBuilder = New
SqlConnectionStringBuilder()
sqlBuilder.DataSource = "VN-DATASOURCE"
sqlBuilder.InitialCatalog = "InitCatalog"
sqlBuilder.MultipleActiveResultSets = True
sqlBuilder.Password = "password"
sqlBuilder.UserID = "userID"
Dim entBuilder As EntityConnectionStringBuilder = New
EntityConnectionStringBuilder()
entBuilder.Provider = "System.Data.SqlClient"
entBuilder.Metadata = "res://*/QEM.csdl|res://*/QEM.ssdl|res://*/QEM.msl"
entBuilder.ProviderConnectionString = sqlBuilder.ToString()
I have this nagging feeling that I am forgetting some IIS or Entity
Framework setting. Any help would be appreciated.
Entity Framework. After installing the application on IIS it works as
expected with one user but as soon as 2 people start working the same
application with different login information the following error appears :
ExecuteReader requires an open and available Connection. The connection's
current state is closed.
I am NOT explicitly opening or closing the database connection whe creating
the context object. I am using the "Using context/End Using" configuration
when I am accessing the entities.
Here is how I am setting up my EntityConnection string
Dim sqlBuilder As SqlConnectionStringBuilder = New
SqlConnectionStringBuilder()
sqlBuilder.DataSource = "VN-DATASOURCE"
sqlBuilder.InitialCatalog = "InitCatalog"
sqlBuilder.MultipleActiveResultSets = True
sqlBuilder.Password = "password"
sqlBuilder.UserID = "userID"
Dim entBuilder As EntityConnectionStringBuilder = New
EntityConnectionStringBuilder()
entBuilder.Provider = "System.Data.SqlClient"
entBuilder.Metadata = "res://*/QEM.csdl|res://*/QEM.ssdl|res://*/QEM.msl"
entBuilder.ProviderConnectionString = sqlBuilder.ToString()
I have this nagging feeling that I am forgetting some IIS or Entity
Framework setting. Any help would be appreciated.