Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need best practice advice for data constraints
Message
From
13/02/2008 16:51:25
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
13/02/2008 15:44:08
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01292375
Message ID:
01292409
Views:
19
Sam,

>I have very little experience using MM .NET and MS SQL Server. I hope someone can give me experienced advice and suggestions. I am creating a new SQL database and table. I will be creating a Windows forms application using MM .NET v2.4. One of the columns in the table will be a decimal column and I want to be sure the value in that column is always positive. The value will be entered by the user on a Windows form.
>
>The question is where to make sure the value is positive. I could do it as an SQL constraint on the column. Or I could use MM .NET rules to validate the value. Or maybe I could set properties on the textbox control to validate it. Or perhaps some combination of these or other ideas. It seems like a lot of development work to test the value in all three places, but if that is the best practice please tell me so.
>
The answer might depend a little on what other access occurs to the SQL database. If this application is the only thing that can add or update data in this table then just create a business rule for it in the mmRule class associated with this table. It is a simple check at this point and can take advantage of the broken rules in the UI.
Tim
Timothy Bryan
Previous
Reply
Map
View

Click here to load this message in the networking platform