Aysberq

Change attribute table values of shape file.

Discussion created by Aysberq on Apr 28, 2011
Latest reply on Sep 27, 2013 by erocha-img-com-br-esridist
Hello everyone!
I want to change attribute table values of shape file using C#.
I tried with code below. The code works, but values are not change.

            IWorkspaceFactory workspaceFactory = new ShapefileWorkspaceFactoryClass();
            IWorkspace wrksp = workspaceFactory.OpenFromFile(@"D:\Shape\", 0);
            IFeatureWorkspace pFeatWorkspace = wrksp as IFeatureWorkspace;                                                      
            ITable myTable = pFeatWorkspace.OpenTable("Shape1");
            IWorkspaceEdit wrkspcedit = pFeatWorkspace as IWorkspaceEdit;                     
            if (wrkspcedit.IsBeingEdited())
            {           
                wrkspcedit.StartEditing(false);
                wrkspcedit.StartEditOperation();
            }           
            myTable.GetRow(5).set_Value(8,"anyvalue");          
            wrkspcedit.StopEditOperation();
            wrkspcedit.StopEditing(true);

Can someone help me?
Thanks!

Outcomes