I'm trying to connect to my db on my local machine with the following connection string and it fails for the following connection string
conn = new SqlConnection("Server=(local);DataBase=dnn6;Integrated Security=SSPI");
I'm using IIS 6 as my web server and when I open that page I get the following error.
Cannot open database "dnn6" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\\demo'.
I'm using SQL Server 2012
The problem is that the IIS account being used to access SQL Server ( IIS APPPOOL\\demo
) does not have access to it.
You need to either:
IIS APPPOOL\\demo
to your SQL Server
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.