1

I am trying to deploy my first VB.NET application on GODADDY. I created a SQL server database and was able to create tables using SQL Server Management Studio. I created a user web_user and was able to login to the GODADDY database using that user. However when my website tries to connect with this database using the same user id and password, I get the following error:

Cannot open database "user_auth.mdf" requested by the login. The login failed. Login failed for user 'web_user'.

My connection string is mentioned below. It is similar to what was recommended by GODADDY:

<add name="ConnectionString" 
     connectionString="Server=XYZ;Database=user_auth.mdf;User ID=web_user;Password=zzz;
     Trusted_Connection=False" providerName="System.Data.SqlClient" />

Please help. Its driving me nuts. Stack Trace is:

[SqlException (0x80131904): Cannot open database "user_auth.mdf" requested by the login. The login failed.
Login failed for user 'web_user'.]

  • Any relevant error in SQL Server errorlog. Firewall exception being taken care off ? TCP/IP and named pipes protocol enabled ? Browser service running ? – Shanky Aug 3 '14 at 8:48
  • If you created the database using SSMS, you should use the logical database name and not the file with .mdf in your connection string! Use Server=XYZ;Database=user_auth;User ID=web_user;Password=web_user for your connection string and let SQL Server worry about the file-related details. – marc_s Aug 3 '14 at 9:29
  • Marc, thanks a lot... this worked!! Wow I never thought that would be the root cause. – coderatlarge Aug 3 '14 at 9:46
2

If you created the database using SSMS, you should use the logical database name and not the file with the .mdf extension in your connection string.

Use

Server=XYZ;Database=user_auth;User ID=web_user;Password=web_user 

for your connection string and let SQL Server worry about the file-related details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.