How to detect overflow legnth on a field?

Posts   
 
    
ianvink
User
Posts: 394
Joined: 15-Dec-2006
# Posted on: 27-Nov-2007 13:25:49   

How do I determine at run time the max length that a varchar() field can contain?

Right now I get a nice overflow exception from my property in the EntityBase at this point.

        public virtual System.String AAA
        {
            get { return (System.String)GetValue((int)AAAFieldIndex.AAA, true); }
            set { SetValue((int)AAAFieldIndex.AAA, value, true); }
        }

of course I'd rather just check the input first.

goose avatar
goose
User
Posts: 392
Joined: 06-Aug-2007
# Posted on: 27-Nov-2007 16:28:14   

How do I determine at run time the max length that a varchar() field can contain?

    _YourEntity_Fields.Descripcion.MaxLength