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
 Development Tools
 ASP.NET
 Cannot open database requested by the log

Author  Topic 

yshie
Starting Member

28 Posts

Posted - 2007-03-28 : 12:06:57
Visual Studio
MS SQL Server
i have this connection string...
Data Source=.\SQLEXPRESS;Initial Catalog=dbName;Integrated Security=SSPI;

but an error appears on my conn.Open();
Cannot open database "dbName" requested by the login. The login failed.
Login failed for user 'SERVER\yshie'.

yshie is my username in the computer i use. just to clarify, there are two
user accounts in my pc but both of them are administrators.

graz
Chief SQLTeam Crack Dealer

4149 Posts

Posted - 2007-03-28 : 12:18:59
The problem is that "dbName" doesn't exist. Change it to a real database or master or tempdb.

===============================================
Creating tomorrow's legacy systems today.
One crisis at a time.
Go to Top of Page

yshie
Starting Member

28 Posts

Posted - 2007-03-28 : 12:45:45
but i made this database(dbName) and it exists. or my connection string maybe incorrect. i'm using visual studio 2005 and i create the database in ms sql server that comes with this visual studio.
Go to Top of Page

graz
Chief SQLTeam Crack Dealer

4149 Posts

Posted - 2007-03-28 : 14:07:29
Are the user accounts on your PC or in SQL Server? Those users need to be granted permission in SQL Server. Depending on your operating system the local Administrators group may or may not have been added to SQL Server.

===============================================
Creating tomorrow's legacy systems today.
One crisis at a time.
Go to Top of Page

yshie
Starting Member

28 Posts

Posted - 2007-03-29 : 04:19:32
those are user accounts in my pc. what should i do to make it work in any pc? because im worried that my win app will not work on my professor's pc when she has to check it. i wanna play safe. im sorry but im a newbie bout this. tnx 4 trying 2 help!
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-03-29 : 04:25:27
Is this question related to this?
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81304


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

yshie
Starting Member

28 Posts

Posted - 2007-03-29 : 05:28:28
yes Peso! because it's more on my code now that's why i put my thread here. is it wrong? im sorry..

nway, i noticed something in my Server Explorer. at first, the database is connected. but when i run my application. it becomes an X mark. what does that mean? does it mean disconnected? or it's normal?
Go to Top of Page
   

- Advertisement -