Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Generated Business Rules for Numeric Columns
Message
De
26/02/2009 00:21:43
 
 
À
23/02/2009 15:38:23
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01383003
Message ID:
01384227
Vues:
52
Using the "Allow Empty Value" checkbox along with the "Required" checkbox works as long as I define the database column as nullable. However, in most cases, I do not want to set the database column to nullable.

I believe something isn't quite right with the comingling of datasets and entities. I'm using the entity centric approach so the business rule validation is actually performed on the entity. If my UI control is empty, the corresponding value in the dataset is also empty. If the database column is not nullable, the corresponding value in the entity will be zero, so I lose all ability to validate against the null value. However, when the database save is performed, there is an exception because the null value is still in the dataset.

If the database column is nullable, then the BLG generates a nullable data type in the entity so the null value is carried trhough to the business rules. Everything works okay, except I compromise the database design because I have to set a non nullable column to nullable (I think that is a bad practice).

Al
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform