Showing posts with label explorer. Show all posts
Showing posts with label explorer. Show all posts

Monday, March 19, 2012

Connecting to localhost Problems?

I'm taking a .NET class and I have SQL Server 2005 installed on my
machine. When I go into Studio and then select Server Explorer and try
to add a new Connection, it seems to bomb out when I type in
'localhost' for the server name. It doesn't come back with anything
for the DBS. Is there something I need to do to get my machine to
understand 'localhost'?"Rick" <rlc_60504@.yahoo.comwrote in message
news:1162528400.038379.136840@.h54g2000cwb.googlegr oups.com...

Quote:

Originally Posted by

I'm taking a .NET class and I have SQL Server 2005 installed on my
machine. When I go into Studio and then select Server Explorer and try
to add a new Connection, it seems to bomb out when I type in
'localhost' for the server name. It doesn't come back with anything
for the DBS. Is there something I need to do to get my machine to
understand 'localhost'?


Very likely you have SQL 2005 installed as a named instance, so you have to
specifically provide the hostname AND isntance name.

Quote:

Originally Posted by

>

Saturday, February 25, 2012

Connecting SQL SERVER 2005 EXPRESS EDITION using Server Explorer

Hi all.

I use Visual Studio .NET 2002 and SQL Server 2005 Express Edition as database.

I try to connect to database using server explorer.

Test connection is OK. When I done with it and click OK, the message prompt that "Unable to connect to database".

So, is it impossible to connect SQL Server 2005 Express Edition using the server explorer?

But, the connection is ok when I connect through code cause I can retrieve and update database.

Hi azrina,

From your description I would guess, are you connecting to your sql express database both from your code and server explorer? and besides, you choose "auto attached" for your database file(.mdf), am I right?

If yes, i would say, well, since sql express use "custom instance" and there is a basic principle that one mdf file cannot be bound to more than 1 instance at the same time, so, if you are accessing your database file from your code, that particular file(say, dbname.mdf file) would be attached to your sql express custom instance. While if now you are connecting to the sql express again from server explorer, probably you will be not able to access that database file --most possibly you will get a "the database file has been already been attached" error.

Anyway, that's just my assumption and I use visual studio 2005 instead of vs.net 2002. And by the way, I've also encountered some kinds of troubles when connecting to my database from server explored--which sometimes I find is hard to descibe and explain.

Just hope my suggestion could help

|||Actually, what I am trying to do is to add database to the server explorer. As I want to use the DataSet, I can just drag and drop the sqlconnection and etc coz vs studio.net tools support the data access using data set. But, I think this version of my Visual Studio .Net does not support the SQL Server 2005 Express Edition. What can I do now is just do the data access thru code and not using the tools provided.

Friday, February 10, 2012

Connect to SQL Server Database with custom port

I have a SQL server database that I am trying to connect to from VS2005 in the Server Explorer.

I am not using the standard port for my SQL server listening port and I don't see where I can tell the Server Explorer to use a different port?

Can someone point me in the right direction for connecting to my database?

Thanks.

There are 3 ways to do it. Here's an article detailed all of them:http://www.databasejournal.com/features/mssql/article.php/3689846

Make sure you read carefully in section: "Connecting Clients When using Specific Part Assignments" as the first 2 methods are for client tool connection and the 3rd is specific for the ConnectionString in you config file.

Hope it helps.

|||

Thank you very much. This was extremely helpful!