Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Generated Business Rules for Numeric Columns
Message
From
26/02/2009 00:21:43
 
 
To
23/02/2009 15:38:23
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01383003
Message ID:
01384227
Views:
53
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
Previous
Reply
Map
View

Click here to load this message in the networking platform