Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error handling, fatal results on constraint in table
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01395947
Message ID:
01396128
Vues:
62
>>Why does mm.net framework not catch these and return some non-fatal error back to the web form? Is there a way I can cause the form to do so, instead of simply crashing?
>
>The framework does not provide built in database error catching and does crash when a database error or constraint occurs. To have the form catch this you would simple add code to your business rule object and this would be caught gracefully with the icon appearing next to the field in error (assuming you coded the rule properly). Why the sample application didn't include the business rule in concert with the database constraint is a mystery to me (either way it demonstrates that there is a need for a business rule in line with the datbase rule).
...
>HTH

Thanks, I suspected as much.

I have already figured out how to use CheckExtendedRulesHook in partial.cs in rules class generated by the MM.NET business layer generator, and emulated the code from the rules generated in the ...rules.cs class. The third value concatenated there this.RequiredFieldMessageSuffix can be replaced with an appropriate literal. That then appears as the alt tag behind the MM.NET error icon that appears by the object associated with the thrown error. I figure we can instruct our users to just right mouse and log at properties of the error icon and read the error msg, setting that as standard way of reporting errors.

As I understand Kevin's documentation, if I have to regenerate my business objects, I can check NOT to overwrite the existing partial classes, so only the top level class will be regenerated, leaving my code in the partial classes intact? I can foresee having to do this as tables change and add attributes as business needs change.

I have been doing extensive stepping through the MM.NET classes after enabling that in Visual Studio, that is helping grasp how the framework works.

Ron.

Ronald D. Edge
Director of Information Services
Indiana University Athletics
http://iuhoosiers.com

"You've got to be very careful if you don't know where you are going,
because you might not get there."
“When you come to the fork in the road, take it”
--Yogi Berra
Ronald D. Edge
Retired from Indiana University Mar 1, 2011

"You've got to be very careful if you don't know where you are going,
because you might not get there."
“When you come to the fork in the road, take it.”
--Yogi Berra
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform