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" wrote:
> 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
>