“The data reader has more than one field” error in Entity Framework

前端 未结 4 1711
我寻月下人不归
我寻月下人不归 2020-12-10 00:42

I\'m executing this simple query with Entity Framework

db.Database.SqlQuery(\"SELECT * FROM hospital\");

But I got this error

4条回答
  •  心在旅途
    2020-12-10 01:19

    This solved my issue, some results where not getting the way it was supposed to

    string storedProcedure = "Admin_AutoGenerateKeywordsFortblCompany @Company_ID=" + CompId;
    
    var s= db.ExecuteStoreQuery>("exec " + storedProcedure).ToList();
    

    here single or multiple results can be caught

提交回复
热议问题