| T O P I C R E V I E W |
| kwan_kwan08 |
Posted - 08/06/2008 : 19:05:26 I try to access a same database using two different system,
a) a window based system and b) a web based system.
Both are using VB.NET. But it seem like the there is either one of them can access the database at a time. When one of them running, the other system unable to access. The error is
"Cannot open user default database. Login failed. Login failed for user 'PY1234\Jen'."
PY1234/Jen is a window authoization. I was using MS SQL Sever Express 2005 and the connection string are
<connectionStrings> <add name="WhyWhy.My.MySettings.BookShopConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\bin\Debug\BookShop.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True" providerName="System.Data.SqlClient" /> </connectionStrings>
As a conclusion i need the database to be connected by multiuser at the same time Any help is appreciated. |
| 2 L A T E S T R E P L I E S (Newest First) |
| kwan_kwan08 |
Posted - 08/06/2008 : 22:23:57 Thank You for your solution. I have solve the problem. i have ammend the database as folloes <connectionStrings> <add name="WhyWhy.My.MySettings.BookShopConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\bin\Debug\BookShop.mdf;Initial Catalog=BookShop; Integrated Security=SSPI;Connect Timeout=30;User Instance=FAlse" providerName="System.Data.SqlClient" /> </connectionStrings> The "user intances" suppose to be taken out but i don't know why there is still error when i take out the "user instance". So i just change it to false to multiuser purpose. Beside that i also disatrached the database attach to VS and SQL Server. |
| sqlAdmin |
Posted - 08/06/2008 : 19:48:07 Based on the error message, the user PY1234\Jen does not have a default database defined in SQL Server and your connection string does not mention to which database to connect the user. Either define the default database for the PY1234\Jen user or specify to which database to connect the user when successfully connected logs in. Just add the Database property in your connection string:
<add name="WhyWhy.My.MySettings.BookShopConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\bin\Debug\BookShop.mdf;Database=YourDatabaseHere;Integrated Security=True;Connect Timeout=30;User Instance=True" providerName="System.Data.SqlClient" />
|