Skip to main content
renamed the title
Link
Farid Cheraghi
  • 8.8k
  • 1
  • 24
  • 55

How doto change field length with arcobjectArcObject?

Source Link

How do change field length with arcobject

I want to change some string field in sdegeodatabse with bellow code. The code are running without any problem. but after running, filed length return to default length. What am i missing?

static void writetablecode(IDataset dataset)
        {
            ITable table = dataset as ITable;

            IFieldsEdit fields = table.Fields as IFieldsEdit;
            for (int i = 0; i < fields.FieldCount; i++)
            {
                IFieldEdit field = fields.Field[i] as IFieldEdit;
                if (field.Type==esriFieldType.esriFieldTypeString & field.Length<30 )
                {
                    field.Length_2  = 30;
                }

            }
        }