I have an empty point feature class and I add a feature using the following code: tab = gdb.OpenTable("\\" + sClassName);
row = tab.CreateRowObject();
row.SetString("TITLE", "Hwy 69/access road");
row.SetString("DETAIL", "there is no valve here");
pt = new Point(1239977, 12558523);
pb = new PointShapeBuffer();
pb.Setup(ShapeType.Point);
pb.point = pt;
row.SetGeometry(pb);
tab.Insert(row);
tab.Close();
I can read the feature just fine using the following code: tab = gdb.OpenTable("\\" + sClassName);
foreach (Row r in tab.Search("*", "1 = 1", RowInstance.Recycle))
{
pb = r.GetGeometry();
pt = pb.point;
Console.WriteLine("x=" + pt.x.ToString() + ",y=" + pt.y.ToString());
string s = r.GetString("TITLE");
Console.WriteLine("TITLE=" + s);
s = r.GetString("DETAIL");
Console.WriteLine("DETAIL=" + s);
}
tab.Close();
But when I try to preview the feature class in ArcCatalog or open it in ArcMap (10.0SP4), I get "Error opening feature class, General function failure". Any idea what I might be doing wrong? (I'm using API 1.2)