Length Validation

Posts   
 
    
Posts: 33
Joined: 05-Feb-2005
# Posted on: 20-Jun-2005 18:11:45   

I am trying to add length validation to one of my IEntityValidator classes, so I just added a loop that iterates all the fields and checks the length. The problem is that if the user enters a value that exceeds the maximum length, an exception gets thrown right when I set the field value. Is there a way to cause this exception not to be thrown? I really don't want to have to write try catch blocks around every field I set.

Jason

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 20-Jun-2005 20:29:29   

The field length is checked in the entity itself, and is there to prevent users to save data which will cause an error later on, hence the exception. It's not optional.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 33
Joined: 05-Feb-2005
# Posted on: 20-Jun-2005 20:36:42   

So try/catch it is. wink Thanks Frans