I want to connect to database with such connection string:
connectionString="Data Source=111.111.111.111;Initial Catalog=test;User ID=user;Password=password"
So, I have default SQL Server instance (MSSQLSERVER) in my server. I found it as local in Management Studio. SQL server is running in mixed mode authentication. I added new login user/password. I attached database as test.
I succesfully connect to SQL server as user/password in Management Studio. But when my web application try to connect to database, SqlException 'Login failed for user' is thrown. Webb application is hosted in IIS 7 in pool with Process Model LocalService.
What's problem?
Thanks.
Best Answer
Not only do you have to add that user to the list of Allow logins for SQL, you also have to add that user into the database itself. So that's two locations... the Logins section, and on the database itself.