Skip to main content
1 of 2

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;
                }

            }
        }