The local program runs normally, but after publishing, it reports that the database failed to open the solution.

Possible reasons are:

When accessing your IIS, the default user ASPNET is used, and your SQLSERVER is configured as a trusted connection, but this user is not added to SQLSERVER.
There are two solutions:
1 Do not use a trusted connection, but in the connection string Specify user name and password.
2 Add ASPNET user to security\login in SQLSERVER, and specify read, write and other permissions
recommended 1.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324696197&siteId=291194637