Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion 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 April 4th, 2011, 12:39 PM
Registered User
Join Date: Apr 2011
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default Using Northwind Sample Database Problem


I am new here. I am learning C# .net 4 by myself. I got a connection problem when I tried runing some simple ADO code.

I downloaded SQL2000.sample.database and install it . In Visual Stadio Veiw manu and Server Explorer/Database Explorer Add connection wizard, I choosed Microsoft SQL Server (SqlClient) for data source, I typed "computer_name\SQLEXPRESS" for sever name. I choose "using Windows authorize" . I choosed "Northwind" for database name. The test connection is successful.

When I running below simple connection code
string source = "server=./sqlexpress;" +
                       "Integrated security=SSPI;" +
                        "Initial catalog=NORTHWIND";
SqlConnection conn = new SqlConnection(source);
I got SqlEXception:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server).

I am not sure I missed somthing or did something. Hope someone here can help me.

I am using Windows XP, Visual stadio 2010 pro version and only have sqlexpress server.


Old April 5th, 2011, 08:24 AM
Friend of Wrox
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts

Please check the following link for different options to connect to SQL 2000:
Om Prakash Pant
Click the "Thanks" button if this post helped you.
The Following User Says Thank You to om_prakash For This Useful Post:
bbbwis (April 5th, 2011)
Old April 5th, 2011, 12:46 PM
Registered User
Join Date: Apr 2011
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default Northwind connection

Thanks for help. I fond the problem. The server in the conecting string should be same as in the server explore ("mycomputername\\SQLEXPRESS"). I only used SQLEXPRESS.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem reading XML file from Northwind Database (SQL 2005) jujiro_eb XML 4 June 5th, 2009 01:57 PM
northwind database terkilsen BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 2 April 3rd, 2006 08:55 AM
Querying the NorthWind Database jazzcatone ASP.NET 1.0 and 1.1 Basics 1 March 19th, 2006 04:36 PM
Northwind database iem BOOK: Professional Crystal Reports for VS.NET 8 August 1st, 2004 11:30 PM

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