>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.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only