Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4.5 > BOOK: Beginning ASP.NET 4.5 : in C# and VB
BOOK: Beginning ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-31180-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5 : in C# and VB 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 May 18th, 2014, 02:17 PM
Authorized User
Join Date: Aug 2012
Posts: 39
Thanks: 4
Thanked 1 Time in 1 Post
Default Chapter 15 - Working with Data - Advance Topics


In this book version, on page 570, a procedure is defined to hook into a databound asp data control, to change the display based on the data that is being displayed. On page 573 near the bottom it mentions that when using a SqlDataSourceControl, DataItems are presented as DataRowViews, and then go onto explaining how to work with them.

What about when using a EntityDataSourceControl? Is there a sample of doing this exercise using Entities instead?

Old May 19th, 2014, 08:29 AM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Hi there,

For an entity data source, you should be able to cast e.Row.DataItem to the type of your entity (like a Genre or a Review) instead of a DataRowView. The remaining code should be more or less the same (except that you now access properties of the object directly.

Hope this helps,

Imar Spaanjaars
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
WebDev123 (May 28th, 2014)
Old May 28th, 2014, 12:04 AM
Authorized User
Join Date: Aug 2012
Posts: 39
Thanks: 4
Thanked 1 Time in 1 Post
Default Great info.

Excellent, that's great. That's what I was wondering - what to cast it to. If I can cast directly into an Entity object that's even better, because I can bypass the extra abstract layer of working with the more nebulous DataRowView.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 15 ecomm_checkout.php javascript not working Boboneil BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 3 November 1st, 2010 08:14 AM
Topics needed in Data Structures c.vikramnarayan C++ Programming 1 June 19th, 2009 09:56 PM
Chapter 1 Page 24 Data Grid + Linked List Box not working VS2008 nineismine BOOK: Beginning ASP.NET 2.0 and Databases 0 May 10th, 2009 03:11 PM
Chapter 11: advance OBJ oriented...QUESTIONS ryan.webb BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 0 May 10th, 2007 09:41 PM

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