Last post Mar 11, 2008 11:28 AM by bullpit
Mar 11, 2008 11:24 AM|dexterm|LINK
I have a web application that I wrote using the Classifieds Starter kit that connects to a SQL Server database. I wrote the application on my LOCAL computer that has LOCAL Sql Server database. The application works fine for me. However, when I change
my connection string in my web.config to point to the database that's on our web site, I get the following message:
Cannot open database "GeekGhost" requested by the login. The login failed. Login failed for user 'xxxxxx'
"GeekGhost" is the name of the database, by the way...
I can't figure out why I can't access the remote database via my application. I can connect to the database through my Sql Server Object Explorer. So, I assumed that the problem lies somewhere in my application. To eliminate that possibility I ran the
Microsoft Web Site Administration Tool from Visual Studio. I get the same error message there as well (however, that's not a really accurate test since the Web Site Administration Tool uses your web.config to determine which database to attach to).
I checked all the obvious:
- the database user specified in my connection string is the owner
- I am using the correct password and login
- I presume that the database is set up correctly since I am able to connect remotely to it from my pc.
I am under a deadline so any help would be greatly appreciated!
Mar 11, 2008 11:28 AM|bullpit|LINK
You have to add the user as an authenticated user for that database in Security.
In SQL Server 2005: Load SQL Server Management Studio -> Go to database in question -> Security node -> Right click Users -> Add New User