Try this:
AttributeCollection atts = EntityPropertyDescriptors.Employee.FirstName.Attributes;
foreach (Attribute anAttribute in atts) {
if (anAttribute is MaxTextLengthAttribute) {
MaxTextLengthAttribute maxAttr = anAttribute as MaxTextLengthAttribute;
MessageBox.Show(maxAttr.MaxLength.ToString());
}
}
Edited by IdeaBlade - 20-Jul-2007 at 2:28pm