Showing posts with label northwind. Show all posts
Showing posts with label northwind. Show all posts

Friday, February 24, 2012

Can't connect to the database using c# express and SQL 2005 Express

Hi

I'm trying to connect to the northwind database thats available online using c# and SQL 2005, both express editions. i used the following command

sqlcmd -S yourServer\SQLExpress -E -iinstnwnd.sql

and it connects to the northwind database. but when it comes to the part where i have to select the data source, there are only 2 available - microsoft access database file, microsoft SQL server database file. but according to the microsoft books that i'm following, there should also be a "micosoft SQL server" in the data source list. because of this i cant connect to the database.

Please help...

thank you

Please verify that you have SQL Server Installed, and it is a running service.

Go to [Control Panel], [Administrative Tools], [Services]

Look for a SQL Server service -most likely MSSQL$SQLEXPRESS

|||

hi,

all the Express version of Visual Studio only allow connections to SQL Server databases in User Instance scenario.. this is true for the VS wizards only, where you can connect to "traditional" SQL Server instance's databases via code..

regards

|||

thanks a lot guys

Can't connect to SQL server Northwind database

I am trying to connect to SQL 7.0 northwind database via visual studio
2005. But I can't open the connection. I get an error saying remote
access is not allowed. But the remote access is ok. I can used the same
login and connect to the sql server via enterprise manage.

SqlConnection conn = new SqlConnection("Data
Source=(sqlserver:1433);Initial Catalog=Northwind;User
ID=me;Password=mypassword");

The above is the string I am trying to use.

Is there a way to do this in Visual studio thankspodx (nate.eckstine@.seattle.gov) writes:

Quote:

Originally Posted by

I am trying to connect to SQL 7.0 northwind database via visual studio
2005. But I can't open the connection. I get an error saying remote
access is not allowed. But the remote access is ok. I can used the same
login and connect to the sql server via enterprise manage.
>
SqlConnection conn = new SqlConnection("Data
Source=(sqlserver:1433);Initial Catalog=Northwind;User
ID=me;Password=mypassword");
>
The above is the string I am trying to use.


Is the name of the SQL Server machine realluy "sqlserver"? If SQL
Server is running on your local machine, try "(local)" instead.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx