Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Express Edition and Compact Edition (2005)
 Cannot Open Database after Publishing

Author  Topic 

Daigu
Starting Member

1 Post

Posted - 2007-02-11 : 14:43:47

Hi All,

I have developed a database application using c# and SQL Express 2005.

I have coded a connection string that works fine on the development machine but upon publishing to another machine I am getting the following error message:

Cannot open database "name of database" requested by the login. The login failed. Login Failed for user "machine name\user name".

The remote machine has SQL server express installed.

Now on the development machine the machine name and user names are different to that on the remote machine. I am using Windows Auth. The application successfully runs on the remote machine. It even updates the same database (as mentioned in the issue above) on a different form which all connection strings etc were created automatically by c#. I'm pretty new to all this and don't know where to go from here.
Any help would be greatly appritiated.

Thanks
Jon.

dirac
Starting Member

12 Posts

Posted - 2007-06-08 : 10:01:42
hi , i am not an expert but i had the same problem times before and i solved that by changing my connection string(you can use a one with " attach db" sentence ."and a forced solution is to setting up a sql server management studio to the second machine and attach it manually adn lead it to the address folder of your database :)"
and try connectionstrings.com
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-06-08 : 13:05:18
Ensure "machine name\user name" is valid sql login in sql server.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-06-08 : 13:19:43
Did you unorphan the account using sp_change_users_login? Is the default database set to an accessible database?

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -