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 October 3rd, 2008, 02:20 PM
Authorized User
 
Join Date: Sep 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can't get started

Hello,

I purchased this book to get an intro to website creation and a little taste of the newer technology. (I am an ex-mainframer, currently unemployed). My system @ home is XP-Media Center and I downloaded and installed Visual Web Developer, SQL Express 2005 and I downloaded the app from the Wrox site and (I think) followed the instructions in Appendix B.

Upon trying to initially start the site, it loaded into VWD ok (the code for the main page came up) but pressing f5 results in the following error:

Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.

I'm not the first to see this one but the other 2 posts were not responded to (or the resolutions were not clear - ie referred to other sites, etc).

It seems to me that the database must be defined somehow in SQL Server? That step never took place as far as I can tell (unless it's baked in to the unzip process somehow?).

I'd most appreciate a little direction. I don't necessarily need a definitive answer but a little "try this" or something to get me going.

Thank you,
Shane (in Ohio)




 
Old October 3rd, 2008, 02:36 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,

What happens when you try this:

1. File | New | Web Site

2. Switch Default.aspx into Design View

3. Drag a Login control on the page (<asp:Login />)

4. Hit Ctrl+F5

5. Try to log in

Do you get the same error? If so, are you sure SQL Server is installed correctly?

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 October 3rd, 2008, 03:05 PM
Authorized User
 
Join Date: Sep 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Imar, thanks for the prompt reply.....

I presume "drag a login control on the page" refers to dragging it from the pallet on the left? If so, I'm not sure where to place it?

ie - this is what I'm dragging over:
"<asp:login runat="server"></asp:login>" but it means little to me.

I tried putting at the top but it did not like it!

Sorry to be such a beginner....

Can you still help (please).

- Shane

 
Old October 3rd, 2008, 03:10 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

If you drag it into the code view, it must be between the <FORM> and </FORM> tags.

And can you define "did not like it"??? It refused to put the control where you placed it? Or it gave you an error message? If a message, what?
 
Old October 3rd, 2008, 03:26 PM
Authorized User
 
Join Date: Sep 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

1 - put the login control between <form> and </form>

2 - pressed "ctl-F5"

3 - a page came up with login info
(user name and password with "LOG IN" at top)

Thanks again



 
Old October 3rd, 2008, 04:03 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Did you then *TRY* to log in, as Imar suggested??

(You should be denied permission, because you have not yet established any "users" in your database. But the fact that you *are* denied, instead of getting the same kind of "Failed to generate..." error, is indicative that SQL Server is indeed up and running. If you do get the "Failed..." error, then you will need to figure out why SQL Server isn't running on your box. [I'd suggest uninstalling it and reinstalling, as a first step.] So you can see that WHAT happens gives us a lot of information.)
 
Old October 3rd, 2008, 04:31 PM
Authorized User
 
Join Date: Sep 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks "OP"

I did try to log in. (Initially, I did not because I had no clue what the "ID/pswd" would be.) I was NOT denied, instead I received the "Failed to generate a user instance..." message again which according to your thinking would indicate that SQL Server is not running?

I THINK I installed OK but I'll start over from the beginning. Instead of downloading MS Visual Web Developer (and that includes the SQL Express) I downloaded SQL Express separately and I was never totally convinced I was doing things correctly. The attempted download of SQL Express 2005 as a component of the MS-VWD download (like in the book) was unsuccessful so I took the other route.

Generally, what I do NOT understand is how this demo could possibly work without first defining a database in SQL Server and then loading in the data from the Wrox application, setting up ID's, etc. Perhaps I need to take a SQL Server primer first?

I can see that you read this post carefully and I really appreciate your help! If you have any other suggestions, please respond.

Thank you,
- Shane

 
Old October 3rd, 2008, 04:55 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

It seems to me that the database must be defined somehow in SQL Server? That step never took place as far as I can tell

Not sure which DB you are referring to. I know nothing about the book/project from your original post.

But referring to authentication (the <asp:login> stuff): No, the DB isn't defined in SQL Server, per se. The Visual Web Dev project *uses* SQL Server to then define the DB. So if SQL Server isn't there, indeed it will fail to "generate a user instance."

Understand, SQL Server runs as a separate process from VWD, as a Windows System Service. If you go to CONTROL PANEL==>>ADMINISTRATIVE TOOLS==>>SERVICES, you should find SQL Server (of some flavor) listed there and marked as "Started". If it is listed there but not as "Started", and if "Startup Type" is manual, then just click on it and then click on "Start this service". If it is listed there as "Automatic" for Startup Type, then I dunno why it isn't also Started.

If it's not listed at all, then it didn't get installed properly.

You are pretty much reaching the limit of my knowledge. I've used VWD and I've use ASP.NET, but mostly old version 1.1. The automatic authentication via <asp:login> is new to me.

Generally, what I do NOT understand is how this demo could possibly work without first defining a database in SQL Server and then loading in the data from the Wrox application, setting up ID's, etc.

Agreed. But now you'll have to ask some WROX person. Imar??? You reading?
 
Old October 3rd, 2008, 07:14 PM
Authorized User
 
Join Date: Sep 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OP, We have out of town visitors for the weekend. I'll jump back on this issue once they're gone. I wanted to let you know because you were so gracious in helping me. Thanks, -Shane

 
Old October 4th, 2008, 02:48 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Shane,

The database (called aspnetdb.mdb) is generated automatically by ASP.NET as soon as it sees code or functionality that requires it. At the end of my initial 5 steps (sorry for not telling you to use a random user name and password) something like this happens:

(5. Try to log in)

6. .NET checks the configuration file for the web site for information about Membership (which is what the Login control uses). If you haven't overridden anything there, it finds no config info there.

6. It then checks the Machine.config file, the central .NET configuration file and finds a default connection string called LocalSqlServer that points to a database in your site's App_Data folder and that uses .\SqlExpress as the default database server.

7. ASP.NET then determines that the database doesn't exist yet (the first time you try this code) and then creates one for you against the .\SqlExpress installation, and adds the necessary tables, stored procedures and so on necessary for the Login functionality.

My guess is that in step 7 something goes wrong. Either .\SqlExpress doesn't exist, the service isn't started, or do you don't have the necessary permissions.

You could try downloading the SQL Server Management Studio Express Edition for free and see if you can use it to connect to your server. If not, you may need to (re)install SQL Server:
http://www.microsoft.com/downloads/d...displaylang=en

The steps I described here are by design, and an integral part of the ASP.NET Membership and Roles functionality. I think the idea about auto-creating the database is that in 99% of the case "it just works". Just drag a few login controls (like a CreateUserWizard, Login and so on) and you're good to go. You could then create a new user, login, reset your password and so on. I guess you fall in that 1% category... ;)

Hope this clarifies things a bit.

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
Getting Started ColinWatt BOOK: Professional Microsoft Robotics Studio ISBN: 978-0-470-14107-6 1 November 7th, 2008 02:08 AM
Getting Started? seananderson Reporting Services 0 August 3rd, 2007 07:45 AM
Getting Started st3ve Javascript How-To 1 February 3rd, 2005 08:49 PM





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