Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GridView save nullable integer
Message
From
17/08/2007 11:28:02
 
 
To
17/08/2007 10:17:02
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01248755
Message ID:
01248781
Views:
19
There seems to be a general problem where mmGridView.BindBack() causes unhandled exceptions with invalid (mostly null) data BEFORE the business rule check.

It seems that the solution is either:

1) subclass mmGridView, override BindBack(), and

a) do some instance code for each table/gridview's data particularities. Horrible.

or b) have some general solution where BindBack() checks nullable and returns some obviously invalid token to be checked in the business rules later.

For example, a blank integer where 0 and -1 are valid entries might get set to -999999 as a "set me to DBNull flag" and just hope that value's never a valid entry. Horrible.

or 2) manually do data and business rule checks and cancel out before the call to
        // Save the DataSet (the GridView automatically binds back)
        mmSaveDataResult saveResult = this.Save(this.oManualCountSheet, dsManualCountSheet);
(But this still wouldn't handle the case where data is supposed to be nullable.)

Suggestions please! Thanks!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform