Unable to evaluate the expression. Operation not supported. Unknown error: 0x80070057. Using Linq

0

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=&quot;data source=USER\SQLEXPRESS;initial catalog=projecta100333Entities;integrated security=True;multipleactiveresultsets=True;application name=EntityFramework&quot;" providerName="System.Data.EntityClient" />
c#
entity-framework
linq
asked on Stack Overflow May 31, 2018 by NOSMILE • edited May 31, 2018 by NOSMILE

1 Answer

0

Refer to this. Just change return list; to return list.ToList();

Entity Framework is throwing an error "Unable to evaluate the expression. Operation not supported. Unknown error: 0x80070057."

answered on Stack Overflow Sep 7, 2018 by Maxcom • edited Sep 11, 2018 by Maxcom

User contributions licensed under CC BY-SA 3.0