Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 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 September 6th, 2006, 08:49 PM
Registered User
 
Join Date: Sep 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Table Adapters

I was wondering why you manually entered all your data access code instead of using Table Adapters in all your projects?

Also, what do you see as the benefits / drawbacks of using Table Adapters?

Thanks,
Marc
 
Old September 15th, 2006, 07:59 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Marc,

Sorry for my late response. I was on vacation for the past few weeks.

The biggest reason I am using custom business and data access layers is flexibility and validation. With a table adapter and typed datasets, it's hard to add custom logic to properties like date of birth (smaller than today).

With a typed dataset, you can manually change the generated code. However, this way you can no longer regenerate the code when the model changes. Alternatively, you can derive from your own custom dataset and override methods like ColumnChanged to perform the validation. However, with such a solution, you end up with a lot of code and you loose some of the design time capabilities in Visual Studio.

In the company I work for, most of the business logic we manually add to the business and data access layers is generated anyway, using code generators, Visual Studio's diagramming tools, or coding tools like Code Rush. So, in the end, we don't type that much code anyway.

That said, Table Adapters and typed datasets have their places. I use them every now and then for quick and dirty solutions / demos / proto types.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
While typing this post, I was listening to: Shadowplay by Joy Division (Track 9 from the album: Heart And Soul (CD 1)) What's This?
 
Old September 21st, 2006, 08:08 PM
Registered User
 
Join Date: Sep 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the info.
The more I research this, I find the same answers. I, too, like more control over my code, so I think I'll go your route.
I just wish that MSDN docs would explain things as you have.
They demonstrate all these new features for 2.0, but don't explain when you probably don't want to use them.
 
Old September 23rd, 2006, 05:16 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Well, the TableAdapters and other features certainly have their places. They are great for demos that don't require complex business layers. They are also great for many simple data driven tasks.

But I agree, it can be hard to see what to use when and in what situations...

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing the Control Adapters Randy-s BOOK: Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages ISBN: 978-0-470-12448-2 5 June 26th, 2009 07:59 AM
ASP.NET CSS Friendly Control Adapters VeganMan BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 April 8th, 2008 09:21 PM
Populate a List Box with Table Names & Table date hewstone999 Access VBA 1 February 27th, 2008 10:10 AM
(oracle 8i)Alter Table <table> coalesce partition combo Oracle 3 October 13th, 2004 09:35 AM
size of table (type table is table of number) MikoMax Oracle 1 November 19th, 2003 03:11 AM





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