Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can't connect to local SQL Server
Message
From
08/01/2008 17:01:35
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
01280363
Message ID:
01280382
Views:
15
>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.

Derek,
Nortwind is not one of SQL2005 sample databases (but there is a link to download and add). Did you install it? Probably you installed only AdventureWorks database. What does management studio show in your databases? (if during install you didn't select sample dbs do not install by default)
Try the connection with database Master and query databases on SQL server (sp_help, sp_databases).
PS: Also it is unlikey that your server is local but:
server=.\sqlexpress

if you didn't change it to default instance during install.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform