Wrox Programmer Forums
|
BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio
This is the forum to discuss the Wrox book ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solution by Vincent Varallo; ISBN: 9780470396865
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 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 June 10th, 2009, 12:32 PM
Authorized User
 
Join Date: Mar 2009
Posts: 27
Thanks: 1
Thanked 0 Times in 0 Posts
Default Classic datareader approach

Hi Vince,

You talked in one of your previous threads that you use to use the classic datareader approach before switching to linq to sql.

I was wondering if you could help explain to me using the classic datareader or datatable approach, but using the new Generic class. Here's what I would like to do, using your methods, if possible.

Currently you have an ENTBaseData class that uses Generic collection, which I like.
vb =
Code:
PublicMustInheritClass ENTBaseData(Of T)


Now, I can create a class (AddressTable) that will look like my results set, some properties.

Create another class(e.g. AddressData) that inherits ENTBaseData(Of AddressTable)

Now can datareader use ToList method or can datatable use the ToList method. Or, can you tell me how to get a class that can use the ToList method so I can keep my ENTBaseData class generic.

For example, AddressData class would have a method called SelectAll, in here I would need a connection and return a datareader or datatable and call the ToList to populate my list of AddressTable. How can I do this, if possible?

I have done this before but not using the Generic collection, but rather creating my own collection and added a new item class to the collection over the iteration.

Thanks,
realkewl






Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with approach rickyc1 Classic ASP Databases 4 July 14th, 2005 10:26 AM
Datasets - what is the best approach? Dave Stumbles VB Databases Basics 0 January 12th, 2005 05:21 PM
what is the common approach for it? thanks Robin1 Classic ASP Databases 6 September 11th, 2004 04:14 AM
what is the benefits for each approach alyeng2000 SQL Server 2000 6 December 31st, 2003 05:48 AM





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