Cannot log in to SQL Express from ASP.NET app

  • I have SQL Express loaded on a separate box. I have my ASP.NET loaded on my local machine. When I try to connect I get the following error:

    {"Cannot open database \"MyDB\" requested by the login. The login failed.\rLogin failed for user 'sa'."}

    This absolutely mystifies me because the same UID and Password in my connection string is the one I use to log into SQL Express locally and it works just fine. I believe this to be a SQL Express specific problem but I am not quite sure what. Any ideas?

  • For one thing, I do not see that you are specifying the name of the box that the SQL instance is residing.

    And second, you should Never, Ever use the sys admin account for anything, especially not an application login. Create yourself a simple user account and give it no permissions what so ever. You then grant that user execute only to the stored procedure that you are using in the application. That is it.

    I am not sure, but I am thinking that I read this some where. I thought that SQL Express would not accept a remote login. I have never used SQL express, so I may be mistaken.

    Andrew SQLDBA

  • It allows remote connections per the KB article here:

    http://support.microsoft.com/kb/914277

    Followed the instructions still no change.

  • What type of .NET app? Web App, or Client Server App?

    What does the connection string look like?

    Thanks for the Article about Remote Connections

    Andrew SQLDBA

  • Remote connections are disabled by default, but they can easily be enabled.

    What connection string are you using? It appears that you haven't necessarily specified an instance from the error, and that is the default for SQL Express as well.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply