I making a ASP.NET CORE 2.1 website. The database in Visual studio works fine, but when i deployed to the IIS which on another computer, the database not work. In log, the error:
fail: Microsoft.EntityFrameworkCore.Query[10100]
An exception occurred in the database while iterating the results of a query for context type 'WebApplication3.Data.ApplicationDbContext'.
System.ArgumentException: Keyword not supported: 'id'.
.................
The connectionstring in the web.config:
"ConnectionStrings": {
"DefaultConnection": "Server=.\\SQLEXPRESS;Database=XXXX;Trusted_Connection=True;ID=XXXXXXX;pwd=XXXXXXXXX;MultipleActiveResultSets=true "
},
I read lot of articles for this, but i cant add any plus tags for the connection string, wil be error, the connection string is bad? When i run the project the in Visual Studio i can use database and i see the database in the SQL Server Managment Studio.
For the database i use the "stock database" when created a the project in visual studio. Because i use Entity Framework i need another format connection string? Stock Databse
Trusted_Connection=True;ID=XXXXXXX;pwd=XXXXXXXXX;doesn't make sense. If you are using a trusted connection you don't pass the username and password (and conversely if you aren't using a trusted connection you do pass the values).An exception occurred in the database while iterating the results of a query for context type 'WebApplication3.Data.ApplicationDbContext'. System.Data.SqlClient.SqlException (0x80131904): Cannot open database "XXX" requested by the login. The login failed. Login failed for user 'IIS APPPOOL\XXXv11'.IIS APPPOOL\XXXv11doesn't have access to the database then, @bobo. You need to check the user/login's permissions on your SQL Server and provide it with the relevant/correct permissions (we don't know what those are, we know nothing about your system, or what it does).