Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you handle message of failure?
Message
De
29/03/2010 17:04:44
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01457950
Message ID:
01457955
Vues:
50
>I am looking for input on how your UI layer handles messages of failure to update database because of constraint violation. For example, if a user enters a value in a FK column that has not match in UNIQUE field of primary table, this will cause the update to return an error. The error message is very long and very technical in nature. Do you show the entire message to your users and hope they understand? Or what other approaches you use?

I always use an approach like this:
            Try
                oDataAdapter.Fill(oDataSet)
            Catch loError As Exception
                cError = loError.Message

                ' Try to extrapolate
                Select Case cError

                    Case "External table is not in the expected format."
                        cError = aMessage(1, nLanguage)

                    Case "'Schema$' is not a valid name.  Make sure that it does not include invalid characters or punctuation and that it is not too long."
                        cError = aMessage(2, nLanguage)

                End Select

                Return False
            End Try
So, basically, if there are any specific errors you would like to catch, you can had a hook in there. Otherwise, it would be the error returned by the exception.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform