Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Design assistance
Message
 
À
02/12/2005 09:22:33
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01074006
Message ID:
01074978
Vues:
21
>>I am not sure if I am approaching this the wrong way or if I am just making things a lot more difficult.
>>
>>Here is the scenario. I have a custom user control on my form. The user control raises an event, the form executes the method specified. the method makes a connection to a database and tries to update a row in a table. Now lets assume something went wrong (yes it might happen) and the record could not be updated. What is the reccomended (best practive) to convey that information back to the usercontrol?
>
>The best-practice method for "black-box" controls is to catch the error within the control, clean up any connections, readers, etc., and then throw a new exception. The new exception should be a custom type that is defined within the library that contains the control.

I am not attempting to create a "black-box" control. The control is passed 3 datatables (through properties) used to display information to the user (it is a complex treeview control). I don't want the control to know anything about where the datatables came from. Now the user changes the Title of one of the tree nodes (same way as you would rename a folder in the explorer's treeview control). I don't want the control to connect to my datastore to update the name.

Bottom line is that I want to keep data access separate from the custom control.

Einar
Semper ubi sub ubi.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform