c# - How do change field length with arcobject -


i want change string field in sdegeodatabse bellow code. code running without problem. after running, filed length return default length. missing?

static void writetablecode(idataset dataset)         {             itable table = dataset itable;              ifieldsedit fields = table.fields ifieldsedit;             (int = 0; < fields.fieldcount; i++)             {                 ifieldedit field = fields.field[i] ifieldedit;                 if (field.type==esrifieldtype.esrifieldtypestring & field.length<30 )                 {                     field.length_2  = 30;                 }              }         } 

it not possible edit length of field, way achieve create new field, copy data new field. http://support.esri.com/de/knowledgebase/techarticles/detail/42783

ifieldedit shouldn't used change existing fields anyway. api reference:

the ifieldedit interface used when creating new fields. should not use modify fields, purpose use iclassschemaedit. in general, when modifying fields, restrictions apply in arccatalog apply in arcobjects; example, cannot change name or type of field.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -