[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2501
  • Last Modified:

Cannot open database "" requested by the login. + SQL Server 2005 Express

I get this error when trying to login to my .NET app.

Cannot open database "Referral" requested by the login. The login failed.
Login failed for user 'Referral'.

Here is my connection string:
            <add name="ProviderConnectionString" connectionString="Data Source=MyMachine\SQLEXPRESS;Initial Catalog=Referral;User Id=Referral;Password=password;"/>

I have logged into the Server via Object exploere so i know the uid and password is correct.

I also have SQL 2000 on the local machine as well.

Any ideas on this? I can;t get past this and it should be simple like it is with 2000.
0
tmueller18
Asked:
tmueller18
  • 5
  • 2
  • 2
1 Solution
 
hbustanCommented:
Try changing MyMachine to an IP address and see if that works

Otherwise, see if you can create an ODBC connection that works as well to verify that your settings are correct
0
 
PockyMasterCommented:
You might want to have a look at
http://www.connectionstrings.com/?carrier=sqlserver2005

I normally would specify my providername in my connectionstring.
0
 
tmueller18Author Commented:
ip change didnt help. Same result.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
tmueller18Author Commented:
the connection strings look good. Seems like theres a setting in the DB thats causing me not to connect.
0
 
PockyMasterCommented:
Have you tried connecting using integrated security? It's on your local machine, so you should be able to connect to it in that way
0
 
tmueller18Author Commented:
Data Source=.\SQLEXPRESS;Initial Catalog=Referral;Integrated Security=True

causes this error:

Cannot open database "Referral" requested by the login. The login failed.
Login failed for user 'mymachine\ASPNET'.
0
 
tmueller18Author Commented:
looks like no matter what database i create and grant privledges to it doesnt work.
0
 
hbustanCommented:
Does ODBC work or fails?
0
 
tmueller18Author Commented:
ok..so heres how i fixed it. I installed a new instance and copied all the settings over from this instance over to the one i has having problems with. Golden now. It apeears it was with the TCP/IP and Aliases that was messed up.

Thanks for the help guys.
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 5
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now