Wrox Programmer Forums
|
BOOK: Professional ASP.NET 1.0, Special Edition/1.1
This is the forum to discuss the Wrox book Professional ASP.NET 1.1 by Alex Homer, Dave Sussman, Rob Howard, Brian Francis, Karli Watson, Richard Anderson; ISBN: 9780764558900
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 1.0, Special Edition/1.1 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 8th, 2004, 10:15 AM
Registered User
 
Join Date: Apr 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default code examples do not work cannot connect to server

Hi

I am probably expecting too much along the lines of an 'unzip and get going' type of experience but I cannot connect to the database for any of the examples that come with the book that need to connect to the SQL databases.

I downloaded the sample code and ran the exe to install the samples and all the pages that don't need a database connection are working fine - but on the ones that do need a database connection I get:


SQL Server does not exist or access denied.
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: SQL Server does not exist or access denied.

Source Error:


Line 24: Dim qry As String
Line 25:
Line 26: con.Open()
Line 27:
Line 28: qry = "select * from authors where state='" & state.SelectedItem.Text & "'"


Source File: C:\development\wrox\01 - Fasttrack to ASP.NET\SamplePage.aspx Line: 26


There is something I am not doing I am sure. Do I have to do something in MSDE to select the database I want to connect to? I don't know how to even see the databases in MSDE like you do in Access. I might be being a total noob here. Maybe you can't do that .

Please help me on this. I am an experienced ASP classic programmer and I just want to get started with SQL databases and ASP.net but I have stumbled on the first hurdle.

Please don't hold back with your advice - even if it sounds totally dumb to you it might be the thing that I need to do to get this going.

Thanks in advance.

p.s. on Page 31 the code seems to suggest that the "Data Source=.;"

Can this be correct? I have never seen a data source that is just a single full-stop. I would read on further but I seem to be stuck on page 31 and I find this highly embarassing.



 
Old April 8th, 2004, 02:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Well, the problem with code samples is they don't always use the Northwind or other databases that are already created in SQL Server. There wasn't nothing available that specified for you to create a data source? I've never seen a DSN referenced like that before.

I've always put the connection string in the web.config or app.config file and referenced it there. That way it can be easily changed, and you never know what or what you don't have access to.

Hope this helps,

Brian
 
Old April 13th, 2004, 03:50 AM
Authorized User
 
Join Date: Dec 2003
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default

The Data Source part of a connection string defines the machine and . represents the local machine (a bit like . represents the current directory). The connection strings are stored in web.config, so could you let me know what it says for DsnPubs. Also could you check the install log file for any errors.

Thanks

Dave

 
Old April 13th, 2004, 10:50 AM
Registered User
 
Join Date: Apr 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for your thoughts both of you.

I added a config file to the directory of the first chapter's examples but there wasn't one there already. I am really looking form some people that have installed these examples and got them running so that I can compare what seems to be on my machine against what they had on theirs.

but the setup log has this kind of stuff in it which doesnt look good:
08/04/2004 09:59:01: : File permissions configuration complete
08/04/2004 09:59:01: [Fail] : SQL Server instance 'BLEEPBLOOP\NetSDK' does not exist.
08/04/2004 09:59:01: : Compilation started
08/04/2004 09:59:01: [Fail] : Compilation failed with code 1

08/04/2004 09:59:00: [Pass] : Added write permission for ASPNET to 08 to 11 - Data Management\data02
08/04/2004 09:59:00: [Fail] : Permission change failed with code 8023


08/04/2004 09:58:25: : File permissions configuration complete
08/04/2004 09:58:25: [Fail] : SQL Server instance 'BLEEPBLOOP\NetSDK' does not exist.
08/04/2004 09:58:25: : Compilation started
08/04/2004 09:58:25: [Fail] : Compilation failed with code 1
08/04/2004 09:58:59: : -------------------------------------------


these look like I am supposed to do something else to my MSDE? It has been a long time (like 4 months) since I installed it and I havent ever done a thing with it - so there is a good chance that I had to provide a password or something ages ago when I set it up - but it hasn't asked for one since.

In fact all it does is sit in my system drawer (windows XP pro machine) and offers me the chance to stop services, which will probably not help me any :)

Once again I appreciate the help from you guys but I could really do with some input from people who have done this succesfully.

'so could you let me know what it says for DsnPubs.' can you explain this further please DaveSussman?

thanks in advance






Similar Threads
Thread Thread Starter Forum Replies Last Post
db2 doesn't work as a db for RoR examples rafmathijs BOOK: Beginning Ruby on Rails 0 August 30th, 2007 03:50 AM
Recommended setup to work thru the examples? kjullion BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 1 February 13th, 2006 12:44 PM
code for examples marciann BOOK: Access 2003 VBA Programmer's Reference 3 February 20th, 2005 07:35 PM
Ch 3 Examples Don't Work Gregorio BOOK: Professional Crystal Reports for VS.NET 3 February 15th, 2005 11:36 AM





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