Groups | Blog | Home
all groups > dotnet datatools > november 2005 >

dotnet datatools : SQL 2005 Server doesn't appear in VS 2005 Add Connection Combo Box


Mark Patterson
11/30/2005 5:57:01 AM
After installing VS 2005 (Std.) and SQL Server 2005 (Std.) when I attempt to
add a new connection to the newly installed SQL 2005 Server (Default
Instance--machine name) does not appear in Server Name combo box list on the
Add Connection dialogue.

I CAN add a new connection if I type the name of the server.

This server DOES appear the the list of servers generated by Access and it
DOES appear in the list of Database Engine servers in SQL Management Studio.

So why doesn't it appear the combo box list in the Add Connection dialogue
of VS 2005 Server Explorer?

Any help appreciated...

Mark

Michael Nemtsev
11/30/2005 10:45:29 AM
Hello Mark,

Use SQLEXPRESS as SQLServer name, not just (local) or compname
For example:
MyComp\SQLEXPRESS or (local)\SQLEXPRESS

PS: Make sure that sqlserver has already started in services

MP> After installing VS 2005 (Std.) and SQL Server 2005 (Std.) when I
MP> attempt to add a new connection to the newly installed SQL 2005
MP> Server (Default Instance--machine name) does not appear in Server
MP> Name combo box list on the Add Connection dialogue

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/members/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

Mark Patterson
11/30/2005 12:54:23 PM
Hi Michael,

Thanks for the reply...but I'm confused.

I didn't install SQL Server 2005 Express, I installed SQL Server 2005
Standard Edition, so why would I want to rename the server to the default
instance name for the Express edition?

I DID try what you suggested...but it didn't seem to help. In the first
place I'm not sure how to rename the server. In the SQL Server Management
Studio there is a command to "Register" a server--but instead of renaming the
original instance this command appears to create an alias referencing the
original server instance.

When I install SQL Server 2005 Standard Edition I opted to go with the
Default instance rather than supply my own name. The name of my workstation
(located on our domain "CORP") is "BPTM1" and this name was assigned as the
name of the server instance I installed. I had previously installed the
contact manager ACT on this machine. ACT uses SQL server as well and
installs it's own instance. So after installing SQL Server 2005 and opting
for the default instance I have two servers listed under the Database Engine
server group:

BPTM1
BPTM1\ACT7

After I tried to follow your advice by registering the BPTM1 server as
"BPTM1\SQLEXPRESS", opening the registered servers window within SQL
Management Studio shows three listings:

BPTM1
BPTM1\ACT7
BPTM1\SQLEXPRESS (BPTM1)

I'm assuming that the parenthetical expression following third listing
suggests that this is actually an alias to BPTM1. Also even though this is
listed under registered servers...if I close and re-open Management Studio
and then browse for servers this newly registered alias doesn't show up, only
"BPTM1" and "BPTM1\ACT7" does (along with other servers on our network).

In any event merely registering this alias did not help this server appear
in the list of servers within the Server Name combo box of the Ad Connection
dialogue of Visual Studio 2005 (standard edition).

You suggested that I make sure that the BPTM1 Server it was started, and yes
it was. As I mentioned in my original question, I CAN create a working
connection to this server within VS 2005, but to do so I have to type
"BPTM1\" in the Server Name combo box rather than just opening the drop down
list and selecting it from the list (it doesn't show up there only
"BPTM1\ACT7" does).

So the server is there and running, I can connect to it by entering the name
manually, but it fails to display in the list of servers in the VS 2005 Ad
Connection dialogue box (Server Name combo).

Why?

Mark


[quoted text, click to view]
NO[at]SPAM je
12/1/2005 12:00:00 AM
Mark, are you aware of the configuration options for SQL server 2005? and
have you started the Surface Area Configuration Tool at least once to see
wht's there? It disables most features by default, maybe you need to enable
more?
HTH,
Ed Richard


[quoted text, click to view]

Mark Patterson
12/1/2005 5:47:04 AM
Thanks Ed,

Yes I'm aware of the SAC tool and have enabled everything there I can.
However I still can't get my SQL 2005 Server to show up in VS 2005 (although
I can connect to it if I type in the server name manually).

[quoted text, click to view]
Mark Patterson
12/1/2005 5:58:02 AM
Just a follow-up...

I have now installed VS 2005 Standard Edition along with SQL Server 2005
Standard edition two times (once on my laptop and once on my desktop).

BOTH TIMES the same problem occurs. So whatever I'm doing wrong, or not
doing right--at least I'm being consistent about it.

Am I the only one having trouble getting a new instance of SQL Server 2005
to show up in the Server Name combo box of the VS 2005 Add Connection
dialogue?

Again this server instance shows up everywhere else (MS Access, SQL
Management Studio) so the basic configuration of the installation has to be
correct. And since I'm able to connect to the server in VS 2005 by typing
the name of the server and selecting my desired database--it's obvious that
VS 2005 is able to recognize and work with the Server and databases it
contains.

So what is preventing VS 2005 from including the new SQL Server 2005
instance from being included in the list populated for the Server Name combo
box of the Add Connection dialogue????

COULD THIS BE A BUG IN VS 2005???

It's hard to imagine that something so obvious and top level wouldn't have
been caught and corrected by now--so I'm guessing it's NOT a bug but
something I'm doing wrong.

Before installing SQL Server 2005 Std. Edition I had previously installed
SQL Server Express Edition, but I removed this installation prior to the new
install--so hopefully that didn't create any conflicts.

On both my laptop and my desktop I have ACT installed which installs a
private instance of SQL Server 2000. These ACT SQL Server instances DO show
up in the VS 2005 Add Connection Server Name combo drop down list. Is it
possible that the presence of these SQL Server 2000 instances is somehow
causing a problem for VS 2005 when it tries to populate that combo box?

If anyone out there has experience with SQL Server 2005/VS 2005 and has any
idea of what is going on I would appreciate your insights!

Thanks,

Mark


[quoted text, click to view]
Mark Patterson
12/1/2005 4:25:02 PM
Hi Jerome!

Thanks for your suggestions. Connecting to my data has never been a
problem. My original (and continuing question) was why my newly installed
SQL Server 2005 Standard Edition instance didn't display within the drop down
combo box in VS 2005 (standard edition).

From your comments it appears that you're working with the Express Editions
of VS and SQL Server. Before installing the Standard Editions of VS 2005 and
SQL Server 2005 I too was running the Express Editions. Frankly I was amazed
at how powerful these free "Express" editions were! Competely adequate for
creating significant applications. I think Microsoft is VERY SMART for
making this move because they are going to end up with hundreds of thousands
of developers world wide who discover how great the 2005 technology is.

Ok enough rambling... now here's what I've learned as I've explored this
issue:

When you install SQL Server 2005 Standard Edition (NOT Express Edition) and
opt to install the default instance, it creates a server instance that has
the same name as the machine name it is being installed on. My desktop is
named BPT1 and so the default 2005 Server instance created was also named
BPT1.

When I open SQL Server Management Studio the instance BPT1 appears in the
initial drop down combo box enabling me to connect to this instance. If
you're working with SQL 2005 Express you wont have access to Management
Studio, but you will have access to a tool that is very similar--a CTP beta
Express equivalent of Management Studio. So the instance "BPT1" shows up
just fine in SQL Management Studio.

Now within VS 2005 (standard edition--which will be different than the
Express Edition) when you attempt to create a new connection you must first
select the Data Source from the following list:

Microsoft Access Database File
Microsoft ODBC Data Source
Microsoft SQL Server
Microsoft SQL Server Database File
Microsoft SQL Server Mobile Edition
Oracle Databse

Your best bet is to select either Microsoft SQL Server or Microsoft SQL
Server Databse File. If you select Microsoft SQL Server Database File a
dialogue pops up giving you the opportunity to browse to a *.mdf file that
you want to attach to the default SQL Server instance.

Here's where it gets interesting... If you open the Advanced Tab from this
dialogue you'll enter a property browser. Under Source there's a "Data
Source" combo box and when you open this combo box (which you cannot edit)
you'll find two default entries for the default server instance:

..\SQLEXPRESS
..\MSSQLSERVER

The ".\" denotes your local machine and SQLEXPRESS and MSSQLSERVER are
supposedly the names of the default instance of SQL Server 2005 Express
Edition and SQL Server 2005 (all other editions) respectively.

This works out fine if you've installed SQL Server Express edition because
the default instance IS named .\SQLEXPRESS. However as I explained above,
when the Standard Edition of SQL server is installed as the default instance
IT IS NOT NAMED .\MSSQLSERVER !!! rather it is given your machine name.
(BPT1 in my case).

This means that (using SQL Server Standard Edition) if you want to attach a
database file (as opposed to using a database already running on your server)
YOU CANNOT DO SO USING THE Microsoft SQL Server Database File option from the
Data Source dialogue.

The work around requires you to select Microsoft SQL Server from the Data
Source dialogue. You will then be presented with the Add Connection
dialogue. At the top of this dialogue there will be a combo box for Server
name.

You should be able to just drop down the list of servers and select your
default instance from this list. However as I've explained above the default
instance for SQL Server 2005 Standard Edition DOES NOT DISPLAY IN THIS LIST
(although other local and remote instances of SQL Server 2000 and SQL Server
Express edition do).

So to connect to your newly installed default instance you must type the
name into the text field of the combo box. In my case I have to type "BPT1".


Note: entering BPT1 or BPT1\ will work, but entering ".\BPT1" will NOT
work. So even though BPT1 is a local instance of your SQL Server the local
notation is not recognized in this context.

Once you've typed the name of the server and selected your authentication
method (I always opt for Windows Authentication), you can then opt to attach
a database file. Selecting this radio button enables a browse button that
brings up a file browser.

If you test your connection things will work fine. Also if you open the
Advanced properties dialogue you'll find that "BPT1" (or whatever your
machine name is) will now be shown as the only entry in the Data Source combo.

So I'm able to connect and use my data, but I have to do it in a round about
way. It would have been nice if the default instance name would have matched
".\MSSQLSERVER" (BTW Registering your server instance as "MSSQLSERVER" or
"BPT1\MSSQLSERVER" or ".\MSSQLSERVER" does NOT help) or if the name assigned
(your machine name) would be listed by the Server Name combo box.

So I've concluded that this IS a bug in VS 2005 Standard Edition. SQL
Management Studio has no problem listing the "BPT1" instance in it's combo
box, VS 2005 should have no problem finding this server as well.

I've gone to the trouble of typing this up in hopes of helping someone else
who experiences the same problem--which is very likely since the Standard
Editions of VS 2005 and SQL Server are being given out by the thousands at
the Microsoft "Ready To Launch" and "Best of Ready To Launch" events (which
is where I got my copy--hurray for MS!).

Mark

[quoted text, click to view]
Jerome
12/1/2005 11:02:28 PM
1.
In the dropdown of available servers (in server explorer of VS2005);, just
type "\sqlexpress" after the standard name for your local server. FI: if
your local sql2005 server shows as "MYOWNPC" then just type \sqlexpress
after that (without the quotes of course).
Dont't forget you're working with VS2005 (<G>).

2.
If you have, on a remote pc, already one instance of a sql server(fi MSDE),
then make sure that your 2005 express instance has his Surface Instance
running!! (not quite safe for internet but that's the consekwence for VS2005
express. But with Zonealarm as Firewall you can adjust some things)

It took me 2 days to figure it out concerning sqlexpress and MSDE on the
same machine

Regards
Jerome

"Mark Patterson" <MarkPatterson@discussions.microsoft.com> schreef in
bericht news:E37CDB50-4974-4649-BAE0-368E21973EFB@microsoft.com...
[quoted text, click to view]

Jerome
12/1/2005 11:08:23 PM
ONE MORE THING!!:
In that dropdown for servers in VS2005 you'll find 2 for sql. The lowest one
says "....also for sqlexpress" NEVER USE it because it will corrupt your
database beyond repair. At least it does on NON US windowsXP systems !!

Jerome

"Mark Patterson" <MarkPatterson@discussions.microsoft.com> schreef in
bericht news:E37CDB50-4974-4649-BAE0-368E21973EFB@microsoft.com...
[quoted text, click to view]

Mark Patterson
12/2/2005 6:47:03 AM
Wow! Sorry that your database got corrupted. I used SQL Server 2005
(connecting to the default instance .\SQLEXPRESS) without any problems. So
the corruption you experienced must have come from something else.

SQL Server Express replaces MSDE - just move on to SQL Server Express and
remove MSDE altogether.

As you know SQL Server Express is a great companion to any version of VS
2005 and enables you to deploy data driven apps.

As for VB6...don't waste any more time! Get completely up to speed with VS
2005 and the .NET Framework 2.0 and never look back. There's a lot of
seriously impressive technology here now and coming soon (WinFX, WCF) and
you want to be completely on top of .NET 2.0 and VS 2005 to take advantage of
all this.

Thankfully the availabilty of Click Once Deployment along with the WCF (Web
Services on steroids) will enable us to begin developing SmartClient apps
that USE the Internet as a deployment channel NOT a cludgey, fragile,
stateless, duct taped application framework.

Death to browser applications! Long live Windows Forms based SmartClients!

Mark

[quoted text, click to view]
Jerome
12/2/2005 2:09:30 PM
mmmm
I see this is indeed another matter. Wel...the ways of MS are not always
clear that's for sure.
Now.. what botters me the most is the fact that connecting to a sqlexpress
instance (on the local machine) with the "Microsoft SQL Server Database
File" wich clearly says " also for sqlexpress", my database is corrupt once
i close the connection in "server explorer" ! This does not happen with
"Microsoft SQL Server"
BTW I use MSDE2000 and SQLExpress on one desktop and SQLEpress on the laptop
together with VS2005 Professional. So i expect that this version should at
least be able to connect to all servers.
But i admit that i am new to NET and still learning every day to get a feel
of this in comparison to VB6

Jerome



"Mark Patterson" <MarkPatterson@discussions.microsoft.com> schreef in
bericht news:47BAC383-3E4A-4BF1-90D3-78D5F44631B8@microsoft.com...
[quoted text, click to view]
Jerome
12/2/2005 9:11:44 PM
Perhaps you're right but i have my doubts about working with disconnected
recordsets!
One has to write million lines of code to update the database.
The old way of a recordset and a update or updatebatch was easy
A local dataset on the client side and a powerfailure? I already see coming
the claims of the customers if the database has not been updated when
working on a table with 110 fields ! Imagine the writing for allthose fields
A grid bound to the db and all updates are direct done when moving the
cursor
All those fancy mikmak of coloured forms etc is not what dthe client wants.
But anyway, we have to live with it

Jerome

"Mark Patterson" <MarkPatterson@discussions.microsoft.com> schreef in
bericht news:EB1B8F1F-7819-45F3-9329-ED3D1872A0D8@microsoft.com...
[quoted text, click to view]
AddThis Social Bookmark Button