Connecting to Database

M

Miro

I cant make heads or tails of what I am missing.
I thought i had the answer to this yesterday but apparently I'm still
missing something.

First I needed to get a copy of northwind database, so I was able to
download it from here:
http://www.microsoft.com/downloads/...12-0356-46A0-8DA2-EEBC53A68034&displaylang=en

-Im Running Vista
I then went into my SQL Server Management Studio Express ( right
clicked -and ran as Admin )

Then I attached the database to the server.
I am listed under the Security\Logins <Server>\Miro Public and
Sysadmin are checked for server roles.

Now - comparing two programs vb.net 2008 express and Web Developer 2008
Express

If I go to the database explorer and add a database in vb, i get 2 options:
(I have also tried this by running vb.net as admin as well - right clicking
and run as admin )
Microsoft Access Database File
Microsoft SQL Server Database File

In Web Developer I have way more options:
Microsoft Access Database File
Microsoft ODBC Data Source
Microsoft SQL Server
Microsoft SQL Server Database file
Oracle Database
<other>

(Why different options - I dont understand)

So lets say I want to connect with vb.
Selecting the Microsoft SQL Server Database File
and then in the "Database file name (new or existing),
(local)\SQLExpress\Northwind
Clicking "Test Connection" gives me "This connection cannot be tested
because the specified database file does not exist."

So if I actually click browse and select the path C:\bla\Northwind.mdf
and click "Test Connection" I get a different error:
"Unable to open the physical file "C:\bla\Northwind.mdf". Operating system
error 5: "5(error not found)".
An Attemp to attach an auto-named database for file c:\bla\Northwind.mdf
failed. A database with the same name exists, or specified file cannot be
opend, or it is located on UNC share.

So I assume that error does tell me it does see the mdf file attached to SQL
Express.

What property am I missing?

Im assuming I should be able to refer to my mdf going thru the server
location (local)\SQLExpress\mdfname.mdf


Miro
 
M

Miro

I have uninstalled VB.net and re-installed
and now I have 3 servers...

Microsoft Access Database File
Microsot SQL Server Compact 3.5
Microsoft SQL Server Database File

I still cannot connect thru vb.net with (local)\SQLExpress\Northwind

But thru Web Developer,
Since I do have the option Microsoft SQL Server I can use the
(local)\SQLExpress\Northwind
and I can connect.

I still cant figure out why they show different servers and what the
'proper' way to connect is.

Miro
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top