Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return either dataset or integer from function
Message
De
25/04/2004 12:00:33
 
 
À
25/04/2004 11:43:43
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00892206
Message ID:
00897989
Vues:
22
Hey Nancy,

>Also, you might consider whether it makes sense to throw an exception if no matches are found instead of just setting the DataSet to null.

Actually, I wouldn't do either. If no matches were found, and your DataSet still exists (IOW, don't set it to null), then you'll simply not have any rows in your DataSet. Depending on what you're doing with the returned DataSet, that may make more sense from a coding standpoint (DataBinding to a table with no rows in it most likely will require no additional coding, the stuff in the UI will simply be empty). Obviously though, it depends on what you're doing (your example of a Login attempt is probably better dealt with by an exception rather than an empty DataSet).

Just my 2 cents.

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform