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.
tmueller18Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.