Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 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 28th, 2006, 04:30 PM
Registered User
 
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error when openning solution

--- Error msg
System.Data.SqlClient.SqlException was unhandled by user code
  Message="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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"
  Source=".Net SqlClient Data Provider"

--- Error location
line 120 of App_code.ha5hlyyr.24.cs

Please let me know how to set it right. Thanks.
 
Old June 28th, 2006, 07:20 PM
Registered User
 
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I will suggest two steps:
1)On Web.Config make sure you update the connection string as shown below:

   <connectionStrings>

           <remove name="LocalSqlServer"/>
           <add name="LocalSqlServer" connectionString="Data Source=NR2005;Initial Catalog=TheBeerHouse;Integrated Security=True"
            providerName="System.Data.SqlClient"/>

   </connectionStrings>

I am using SQL 2005 enterprise edition and I have a named server (NR2005).

2) SQL 2005 doesn't allow remote access by default. http://www.datamasker.com/SSE2005_NetworkCfg.htm has a very good explanation on how to configure SQL 2005 to allow remote connections.

I had the same problem and these steps solved the problem.

Good Luck

 
Old June 29th, 2006, 10:20 AM
Authorized User
 
Join Date: Jul 2003
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Tremmorkeep Send a message via MSN to Tremmorkeep Send a message via Yahoo to Tremmorkeep
Default

I'm getting the same error when I publish the site to my site. I'm still working on it. There's SO much to learn.
 
Old June 30th, 2006, 08:04 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You should always get SQL Server working first before you use the C# code. Use Sql Server Management Studio to connect to your DB and pay attention to the name of the DB and your authentication method. On a local computer it typically uses Windows authentication, which means you don't have to log on. This is a good method, and you can indicate that in your web.config connection string also.
  However, you don't have to mess around with connection strings if you're using SQL Server 2005 Express because it's set up to automatically connect you to a database installed under the app_data folder.
  You only need to mess with connection strings if you're not using the Express version, or if you are using the Express version but you want to connect from a non-ASP.NET application.
  Please read the readme.txt in the code download.

Eric





Similar Threads
Thread Thread Starter Forum Replies Last Post
Parse Error Solution ElizabethN BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 6 January 3rd, 2014 05:13 AM
Error When Running Download Solution gazley BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 April 30th, 2007 03:20 AM
Error, Solution. heerajee Pro PHP 1 April 20th, 2006 02:33 PM
Openning a PDF file mcinar Classic ASP Basics 5 February 11th, 2005 11:49 PM
Error opening Solution swandown BOOK: ASP.NET Website Programming Problem-Design-Solution 1 October 28th, 2004 10:30 AM





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