Friday, February 24, 2012

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

No comments:

Post a Comment