An exception of type 'System.Data.Entity.Core.EntityException' occurred in EntityFramework.SqlServer.dll but was not handled in user code

时间秒杀一切 提交于 2019-12-05 13:08:16
user7778612
<connectionStrings>
  <add name ="StudentContext " 
        connectionString ="server=.; database=here your database name; integrated security=SSPI"
           providerName ="system.data.SqlClient"/>
</connectionStrings>

Here is your code but change your database name and then add it into the web.config file.

go to iis -> application pools -> find your application pool used in application -> click it and then click 'Advance Settings' in Actions panel. Find 'Identity' property and change it to localsystem.

please run the project if it runs successfully then good if not may be your solution is in below links.

After fixing the above step Some of you will experience another error saying "SQL Server Login error: Login failed for user 'NT AUTHORITY\SYSTEM'"

So for this please follow below links: SQL Server Login error: Login failed for user 'NT AUTHORITY\SYSTEM'

https://dba.stackexchange.com/questions/47172/can-not-find-nt-authority-network-service-on-sql-server-2012

Here is the answer of this exception ---> Change your name of the connection string, The name must be same like your context class.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!