all groups > visual studio .net enterprise tools > july 2005 >
You're in the

visual studio .net enterprise tools

group:

Server Explorer failling to log in to (local) DB


Server Explorer failling to log in to (local) DB kevin
7/22/2005 1:06:02 PM
visual studio .net enterprise tools:
using VS.NET 2003
server explorer gives me "Cannot connect to database MyDB" error when I
expand the Server node representing my local machine.

The problem is that the DB it is trying to login to has been deleted. How
do I change the default DB that VS.NET is looking for. Creating a new DB in
Enterprise Manager with the name MyDB is a workaround for now but not a
solution.

What about developers who only have MSDE?
RE: Server Explorer failling to log in to (local) DB patrick
7/22/2005 5:08:02 PM
Why not change the login to a database that does exist? I am not sure whether
MSDE has any databases installed automatically or not, but I presume it has
the same ones that ship with the full thing. I don't have much experience
installing SQL server database apps on other machines, yet, sorry.

[quoted text, click to view]
RE: Server Explorer failling to log in to (local) DB kevin
8/9/2005 6:41:02 AM
Patrick,

Yeah... I... um...tried...that :)

The problem is the VS seems to remember the first database that I made a
connection and continues to try and find that database.

[quoted text, click to view]
RE: Server Explorer failling to log in to (local) DB camsl NO[at]SPAM online.microsoft.com
8/9/2005 10:42:28 PM
Hi Kevin,

Your problem doesn't ring a bell. Server Explorer shouldn't be persisting data about what database it was last connected to. When ever I try to expand the MSDE Node on the local machine
the Server Explored doesn't navigate past the server leaf. Maybe I am missing something so if you could provide more detail about how you are navigating to MSDE via SE that would be
helpful.

<My Machine>
|_ SQL Servers
|_<My Machine>

If we are storing the DB name it is probably in the registry. Try searching the registry for the DB Name and see if it comes up. Let me know what you find.

Cameron Slade
Test Manager Visual Studio Data
--------------------
[quoted text, click to view]

Cameron Slade
Microsoft VSData Team
http://blogs.msdn.com/vsdata
--

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm
Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.
RE: Server Explorer failling to log in to (local) DB kevin
8/10/2005 10:16:26 AM
Cameron thanks for your time,

The series of steps that I took

1. Create database DB1

2. From VS.NET Server Explorer create a dataconnecton to DB1

3. Realize that I mispelled the name of DB1: DROP DB1 and try again

4. RETURN TO VS.NET, REFRESH SERVER EXPLORER AND EXPAND Servers - MyMachine
-Sql Servers -MyMachine

At this point I get a SQL SERVER Login dialog box and regardless of the
password/login combination or Integrated Windows Security, the following
message box opens

Title: Microsoft Development Environment
Text: Cannot open database requested in login 'DB1'. Login fails.

"Obviously, you ninny," you say, "You still have a connection defined for a
non-existant database!"

5. Delete the Data Connection for DB1 and try and expand the Servers tree
again. Same error.
6. Close and reopen VS.Net...same error.

My solution was to create a DB named db1 (no tables)



[quoted text, click to view]
RE: Server Explorer failling to log in to (local) DB kevin
8/10/2005 10:20:12 AM
Cameron,

I forgot one thing.

The Sql Server Login box has DB1 in the Database field.

RE: Server Explorer failling to log in to (local) DB kevin
8/10/2005 10:27:03 AM
I may stand corrected!

I don't think that I ever actually deleted The DB1 Data Connection (step 6
in my response).

I just did that and after restarting VS.NET, problem solved.

I also found no referance to DB1 in the registry.

AddThis Social Bookmark Button