John Baird
Coatesville, Pennsylvania, United States
>This is nuts! I'm working with VS 2005 with their SQLEXPRESS database for testing purposes. I keep getting errors when I try a connect string and I need help with this silly problem. The code is:
>
>string conns = "server=(local);integrated security=SSPI;database=Northwind";
>SqlConnection conn = new SqlConnection(conns);
>
>I don't know if Northwind is installed, the 14 books I own says it is. Failure message says:
>
>System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
>
>If Northwind isn't installed by default, I don't need it, I just want to get going with database connections, actually, what I really want to do is programmatically create my own tables in a database but I can't get there obviously.
>
>I thought it may be security related, I'm local administrator on this computer, this is not on a network domain. This is an out of the box install of Visual Studio 2005.
>
>Please help and thanks in advance.
TCP/IP is not enabled by default. Use the configuration manager, choose protcols for your instance and turn on tcp/ip. That should solve your problem.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only