Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 by Chris Hart, John Kauffman, David Sussman, Chris Ullman; ISBN: 9780764588501
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 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 10th, 2008, 03:27 PM
Registered User
 
Join Date: May 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Data error

I'm on p. 196 of Ch.6 of this book, and am instructed to access a page on the provided site (downloaded code). It says in #3 of the Try it Out exercise to View in Browser. When I do, I get the following in IE:

Server Error in '/Chapter06' Application.
--------------------------------------------------------------------------------

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)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
===========================

I checked to make sure that the database exists, and the services are running. I'm using SQL Server 2005 Standard. The first time I posted here a couple of weeks ago, it was pointed out to me that it's assuming that I am using SQL Server Express, and I had to make a change. However, I did that change then, so I don't know that this is the same problem.

 
Old June 10th, 2008, 03:36 PM
Registered User
 
Join Date: May 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I should add that I had to change the database name in the web.config, but restarted my web browser to allow for that. Do I also need to restart Visual Studio?

 
Old June 10th, 2008, 04:19 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You may want to take a look here: http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=395

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
 
Old June 11th, 2008, 10:06 AM
Registered User
 
Join Date: May 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Although that's a helpful article, and I'm going to bookmark it for future use, it didn't contain anything that I was able to use for this issue.

I changed the web.config file to show the correct database instance name, and then the error changed to "The user instance login flag is not supported on this version of SQL Server."

I have Googled this error and haven't found a solution.

I noticed something interesting. In the web.config which came with the book (i.e. the "End" folder), it points to a database called WroxUnited.mdf. However, up till this point, my database for this book has been called "aspnetdb". Notice the name is different and there's no .mdf extension. I am really confused and about to give up on this book.

 
Old June 11th, 2008, 10:28 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

If you are not using SQL Server Express, then simply remove "User Instance=True" from the connection string as the error message indicates.

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
 
Old June 11th, 2008, 10:58 AM
Registered User
 
Join Date: May 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Wow. That did it. In hindsight, it seemed obvious, but it really had me stumped. I should add that I am new to .NET, but that's probably a given.

Anyway, thanks for the help and for showing me your article. It's very informative.

 
Old June 15th, 2008, 01:51 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're welcome. Glad it's working now....

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Export data error Nosfe_X VB.NET 2002/2003 Basics 2 June 27th, 2006 12:06 PM
data environment in data report- error?Why myth12345 VB How-To 0 February 18th, 2005 03:08 AM
Data Access Error socoolbrewster Access 1 January 7th, 2005 12:53 AM
error in data entry vickyj SQL Server 2000 6 September 13th, 2004 10:02 AM
data report error chow chek VB How-To 1 August 4th, 2003 07:17 AM





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