Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 28th, 2006, 04:30 PM
Registered User
 
Join Date: Jun 2006
Location: , , .
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.
  #2 (permalink)  
Old June 28th, 2006, 07:20 PM
Registered User
 
Join Date: Jun 2006
Location: , , .
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

  #3 (permalink)  
Old June 29th, 2006, 10:20 AM
Authorized User
 
Join Date: Jul 2003
Location: Ogden, Utah, USA.
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.
  #4 (permalink)  
Old June 30th, 2006, 08:04 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
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
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:20 AM.


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