Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I check for DbNull
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
01102095
Message ID:
01102315
Vues:
23
Because they are slow to load? Because they load all schema before every use? Because they won't work if you return anything but the exact data that was pre-generated (ie. they won't work with dynamic query results).

Need more? <g>

Awful things those typed datasets.


Rick,

"Awful?" Hmmmm....not in my book. ;)

I used typed datasets most of the time and don't find them "that" slow to load. Typed dataset performance is also a little better in 2.0 than in 1.1. Also, there's some code over on the CodeProject for a proxy class for typed datasets so that the actual creation only needs to occur once. http://www.codeproject.com/csharp/TypedDSProxy.asp

Second, yes, you need to have a match on both sides. In the beginning, I found that to be annoying, but have long since adjusted. I started using some general techniques to re-generate schemas, especially when reporting/result sets change.

Dynamic query results tend to be a little more difficult to maintain in a multi-developer environment.

Typed datasets have great benefits (I'm sure you know these, but since you said they're "awful")...

1) You get Intellisense for statement completion.

2) If a typed dataset contains table relations, the XML schema definition tool adds methods to the typed dataset class for traversing hierarchical data. And if you don't like the default names for classes, you can use dataset annotations.

3) If you define a primary key for any table in a typed dataset, the class exposes a Find method associated with the column name. A developer can perform a FIND against a table with a primary key of OrderID by using the method FindByOrderID. If the primary key is a concatenation of two columns (CustomerID and OrderID), the developer would use FindByCustomerIDOrderID.

4) Working with null values is a little easier when using Typed Datasets.

5) Typed datasets serve as documentation for stored procedure result sets. They are also extremely valuable in the reporting process. Again, big benefits for a multi-developer project.

6) You can subclass a typed dataset class to add validation code or any other methods for the dataset.

7) Typed datasets can simply design-time data binding

Typed datasets aren't perfect. To make full use, you do need to work them into your overall methodology. And some applications will reap the benefits more than others. But in general, their benefits outweigh their drawbacks.

Kevin









R
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform