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
Post a Comment