I'm trying to access my SQL database to retrieve my data.
public projecta100333EntitiesEntities1 Entity { get; set; }
public ConnectionClass()
{
Entity = new projecta100333EntitiesEntities1();
}
I'm getting this error on connection with the database:
the function evaluation requires all threads to run Image of error when connecting to database
When I reload the error to view the error I get the Count of the table in the database which is 0, when in reality I have 15.
When I continue get the data from the database using LINQ :
public IQueryable<All_Articles> GetArticles()
{
var list = Entity.All_Articles;
return list;
}
The return type is the same:
the function evaluation requires all threads to run
But this time when I reload the error I get this new error:
Unable to evaluate the expression. Operation not supported. Unknown error: 0x80070057.
The connection between the database and Visual studio is done using an entity model. The entity model is connected correctly as the tables are visually shown and when I update them, they update successfully.
The connection string in the App.config and web.config are the same with the correct entity:
<add name="projecta100333EntitiesEntities1" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=USER\SQLEXPRESS;initial catalog=projecta100333Entities;integrated security=True;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" />
Refer to this. Just change return list; to return list.ToList();
User contributions licensed under CC BY-SA 3.0