Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2005 > SQL Server 2005
|
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 14th, 2006, 04:06 PM
Authorized User
 
Join Date: Mar 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error trying to connect with ASP.NET 2.0

(This is posted in the SQL Server forum because it is more a problem with SQL Server than ASP)

I am at my wit's end trying to set up a simple test to retrieve some records from the Northwind database on SQL Server 2005 Express with ASP.NET and C#. Whenever I try to run my application, I get the following error:

ERROR: 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)

I have researched this problem, and done everything I can find online to fix it but no avail. I have gone to SQL Server Configuration Manager and enabled Named Pipes and TCP/IP. I have stopped and restarted the server. Local and Remote connections (Both TCP/IP and Named Pipes) are enabled in the Surface Area Configuration. And yet nothing works. I am totally unable to connect to the database from within my code. I've spent probably about 8 hours wracking my brain trying to figure this out; does anybody know what might be causing the problem and what could fix it?

 
Old July 14th, 2006, 04:10 PM
Registered User
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to DerekComingore
Default

since this is a test, I am assuming both your "app" and DB are on the same physical box...

With that said ensure the shared memory protocol is enabled via SQL Config Mgr., and in your connection string:
"Data Source=.[\NamedInstanceGoesHere];Initial Catalog=pubs;Integrated Security=SSPI;"

http://RedmondSociety.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to connect ASP.NET with Oracle ? ashu_from_india ADO.NET 1 June 10th, 2008 02:32 PM
how to connect MySql Database through ASP.NET v2 shahhussain ASP.NET 2.0 Basics 0 September 27th, 2006 03:59 AM
Want to connect ASP.net to oracle without using AD sandeepk Oracle ASP 0 February 16th, 2006 08:27 AM
Connect to MSDE in with ASP.NET hoeknu Classic ASP Databases 1 February 4th, 2004 09:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.