Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: ASP.NET 4 24-Hour Trainer
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 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 Display Modes
  #1 (permalink)  
Old March 28th, 2013, 07: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! ;~(
  #2 (permalink)  
Old March 29th, 2013, 02: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>
  #3 (permalink)  
Old April 19th, 2013, 09: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
  #4 (permalink)  
Old April 19th, 2013, 10: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.
  #5 (permalink)  
Old April 20th, 2013, 03: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>
  #6 (permalink)  
Old April 21st, 2013, 02: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
  #7 (permalink)  
Old April 21st, 2013, 11: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
 


Thread Tools
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
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 03: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 05: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 11:47 AM



All times are GMT -4. The time now is 11:40 PM.


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