Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Generated Business Rules for Numeric Columns
Message
From
06/03/2009 13:49:31
 
 
To
06/03/2009 12:00:05
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
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:
01386284
Views:
37
Tim,

I think you are focusing too much on default values. I do not believe default values are the solution here because the user could always change or delete them. At the risk of repeating myself, let me try to clarify the issue.

The problem is when you have a non-nullable numeric data type bound to a web control and the user intentionally or unintentionally removes the numeric value (leaving an empty string). Even if you had the zero default at the UI, the user may still accidently delete the zero. This could be prevented with business rules in the UI layer (i.e., client-side validation & scripting), but I'm really trying to exclusively use the business rules feature of MM (which is server-side validation) otherwise I'll have two layers of business rules and two ways of handling data validation issues.

I believe if you were using an older version of MM before the entity centric approach, since the empty value is preserved in the dataset, the null validation would work in the MM business rules. Unfortunately, in the entity centric approach, the non-nullable columns translate into non-nullable datatypes for the corresponding entity properties. There is an empty string in the dataset and a zero in the entity. That's the difference. Therefore, you can't run a null test because it is converted to a zero which could be a valid value.

Al
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform