Wrox Programmer Forums
|
BOOK: Professional Visual Studio 2010
This is the forum to discuss the Wrox book Professional Visual Studio 2010 by Nick Randolph, David Gardner, Chris Anderson, Michael Minutillo; ISBN: 9780470548653
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Visual Studio 2010 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 December 12th, 2010, 09:01 AM
Authorized User
Points: 267, Level: 5
Points: 267, Level: 5 Points: 267, Level: 5 Points: 267, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2010
Posts: 56
Thanks: 17
Thanked 2 Times in 2 Posts
Default Ch23 Page 499 - Clarification please

Half way down this page it says:
"Before creating the template, you will need to enable scaffolding for this table"

I'm a bit confused by this.

If I already have a model.edmx file of my whole database, do I still need to do this?

My confusion may be because I have not yet internalised the meaning of the word "Scaffolding" in the DD context.

Thanks
Ken
 
Old December 12th, 2010, 09:22 AM
Registered User
 
Join Date: Jul 2008
Posts: 8
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hi Ken,

Yes I believe you might not quite understand what we mean by the term Scaffolding in this context. In the context of Dynamic Data, the model.edmx class that you have created is referred to as the Data Model. By itself, this class simply contains a description of whatever tables you have specified from the database and some functions to query and update the data.

However, the model.edmx isn't in any way responsible for generating any web pages to actually display this data to an end user. That is what the scaffolding function provided by Dynamic Data is responsible for.

You can enable scaffolding in one of two ways. Firstly it can be enabled within the global.aspx.cs file by setting the ScaffoldAllTables="true" as described at the bottom of page 488. This will automatically scaffold all of the tables described in your model.edmx data model.

Secondly, you can turn of the ScaffoldAllTables (as the book suggests you do on page 491) and enable scaffolding of individual tables by using the ScaffoldTable(True) attribute (code example shown on page 492).

Regards,
Dave

Last edited by david_gardner; December 12th, 2010 at 09:24 AM.. Reason: Typo
The Following User Says Thank You to david_gardner For This Useful Post:
ken evans (December 12th, 2010)
 
Old December 12th, 2010, 09:34 AM
Authorized User
Points: 267, Level: 5
Points: 267, Level: 5 Points: 267, Level: 5 Points: 267, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2010
Posts: 56
Thanks: 17
Thanked 2 Times in 2 Posts
Default

Hi Dave,
That helps a lot.
So is it the case that:
If I have set ScaffoldAllTables="true" in Global asax
Then I don't need to add the C# snippet on page 499?

Thanks
Ken
 
Old December 12th, 2010, 09:42 AM
Registered User
 
Join Date: Jul 2008
Posts: 8
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Yes, that's correct.
The Following User Says Thank You to david_gardner For This Useful Post:
ken evans (December 12th, 2010)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Source Configuration wizard, Forms<-->database issue (ch23) fortran_ii BOOK: Ivor Horton's Beginning Visual C++ 2008 ISBN: 978-0-470-22590-5 0 October 2nd, 2010 07:28 PM
Clarification o_o BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 0 May 13th, 2010 05:10 PM
Need some clarification rennishj BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 September 3rd, 2009 06:15 PM
ch23 non-hibernate example issue ledford BOOK: Beginning JavaServer Pages 0 March 13th, 2006 05:04 PM
STL's clarification sspr C++ Programming 1 February 23rd, 2006 04:43 AM





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