Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 4 24-Hour Trainer
This is the forum to discuss the Wrox book ASP.NET 4 24-Hour Trainer by Toi B. Wright; ISBN: 978-0-470-59691-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 4 24-Hour Trainer 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 March 28th, 2013, 06:22 AM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 4 database confusion

Hi All. / Toi B Wright please if you see this help...!

I am quite confused at page 50 and 51 of the Book ASP .Net 4 Trainer.
It seems that I do not have the database file for Chapter 4. shown on pg 51.
I am using Visual Studio 2012 and SQL Server 2008. I added my own db called aspnetdb.mdf but it does not have the Tables that I see on page 51 at bottom.

I.e. the mdf db was not included in the disk that came with the book.
I downloaded code and movies from the net but this still does not give me the database.

What am I missing.

When I finish inputting the code in Chapter 4. and I run it I get a horrible error page which I am convinced is due to the fact that there is no database.
However at no time in the book am I told how / what to do etc. re the database.

....... confused, stuck and sad! ;~(
 
Old March 29th, 2013, 01:23 PM
Authorized User
Points: 66, Level: 1
Points: 66, Level: 1 Points: 66, Level: 1 Points: 66, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2010
Location: Dallas, TX
Posts: 18
Thanks: 0
Thanked 1 Time in 1 Post
Default Visual Studio 2012

All of the examples in the book use Micrsoft Visual Web Developer 2010 Express.

The database is created after you run the ProfileObject.aspx page. If you do not successfully run the page, the database is not created. I am asuuming that you are getting an authentication error. You need to update your web.config file to the following.

<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<anonymousIdentification enabled="true" />
<profile>
<properties >
<group name="Preferences">
<add name="Theme" allowAnonymous="true"/>
</group>
</properties>
</profile>
<httpRuntime/>
</system.web>
</configuration>
 
Old April 19th, 2013, 08:10 AM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Hi Toi B Wright. Re: Your advice

Hi I followed your advice and profile remains underlines with the error:

The name "Profile" does not exist in the current context. ProfileObject.aspx.cs

Sorry but if you do see what may be causing this I would really appreciate it.

Stuck at Chapter 4.

Can you offer more information on how web config creates the database.
I think my database is not being created.

Kind regards

Mark
 
Old April 19th, 2013, 09:13 AM
Authorized User
Points: 66, Level: 1
Points: 66, Level: 1 Points: 66, Level: 1 Points: 66, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2010
Location: Dallas, TX
Posts: 18
Thanks: 0
Thanked 1 Time in 1 Post
Default Remove the mdf

You need to remove the mdf file that you created. The system will create it for you. The database is automatically created after you run the ProfileObject.aspx page. Since you already have one, the system is not able to create the correct one.
 
Old April 20th, 2013, 02:27 PM
Authorized User
Points: 66, Level: 1
Points: 66, Level: 1 Points: 66, Level: 1 Points: 66, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2010
Location: Dallas, TX
Posts: 18
Thanks: 0
Thanked 1 Time in 1 Post
Default

Did you update your web.config file? Do you have a profile section.

<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<anonymousIdentification enabled="true" />
<profile>
<properties >
<group name="Preferences">
<add name="Theme" allowAnonymous="true"/>
</group>
</properties>
</profile>
<httpRuntime/>
</system.web>
</configuration>
 
Old April 21st, 2013, 01:52 AM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Hi thanks for msg. still no success

I have copied the configuration into webconfig.
I also looked and there is no .mdf database in the solution.
I have re tried in two seperate solutions but the database does not build.
Wierd?
I'm stumped! :-(

Possibly you have a working solution I can download. I doubt I have entered you code incorrectly.

What I am not sure about is how the web config and profileobject.aspx initiate a database build.

Regards

Mark
 
Old April 21st, 2013, 10:46 AM
Authorized User
Points: 66, Level: 1
Points: 66, Level: 1 Points: 66, Level: 1 Points: 66, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2010
Location: Dallas, TX
Posts: 18
Thanks: 0
Thanked 1 Time in 1 Post
Default Download Code

You can download the code from the following site - http://www.wrox.com/WileyCDA/WroxTit...-DOWNLOAD.html




Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 3 and Chapter 4 Confusion r3n BOOK: Professional ASP.NET Design Patterns 0 November 8th, 2012 04:30 PM
Cookie Confusion? Ian Ryder BOOK: Beginning ASP.NET 4 : in C# and VB 3 March 28th, 2012 02:54 AM
Chapter 12 quickSort confusion scolty BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3 2 May 17th, 2011 04:52 PM
Chapter 3, Exercise 5 confusion Calion BOOK Beginning Lua Programming ISBN: 978-0-470-06917-2 0 November 17th, 2010 01:14 AM
Some confusion as to which SQL to use mark.uk SQL Server 2000 6 August 12th, 2004 10:47 AM





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