Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can i catch exceptions while updating datas?
Message
De
02/01/2004 13:24:09
Norman Avila
Universal Computadora Guatemala, S.A.
Guatemala, Guatemala
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00858100
Message ID:
00863490
Vues:
17
Kevin, Nuri,

These are the same question I want to be solved. As Nuri states,

"application shuts down immediately, this behaviour is not acceptable for professional applications."

What does it has to be done in order not to quit the app. for this kind of errors. for example if a DB rule is broken, just advice the error, and wait user to cancel the saving or he will still get the same error ther is no option.

For example, unique constraint arise
1. pass to a message box the error from the DB with an ok button
2. let the user go to the textbox and change the duplicate value or cancel the editing or new record.
3. if issue a save button again give same error is user did not solve the problem.

with this, app don't crash, user will fix the error or cancel the transaction..

Thanks, I this this should come with the framework since you cannot deliver an app that will crash upon a constraint of the db.

Regards

Norman




>Nuri,
>
>>When i catch an exception;
>>1- application warns the end-user for correction.
>>2- application tries to solve the problem by itself.
>>3- if it's a server object throws exception in order to let the client handle it by itself.
>>
>>when i can't catch those exceptions;
>>application shuts down immediately, this behaviour is not acceptable for professional applications.
>
>Actually, this is the recommended behavior for Frameworks. With a few exceptions Frameworks don't know enough about what causes an error to decide what to do about it. Some "exceptions" to this rule are data access exceptions, such as concurrency conflicts, and so on. You can catch Framework exceptions by overriding the method that contains the code that causes the exception...for example, SaveDataSet() in a business object method. If an error can't be handled at the Framework or application level then the best thing to do is to shut down the application because the environment has become unstable.
>
>That said, is there a particular exception that is being thrown that you want to catch?
>
>Regards,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform