Good morning,
I'm writing a little experimental code to use the EditOverlay and a road feature SQL Server table to split a road at the point where the user adds a new vertex. (I'm using LineOnALine to get two new LineShapes, but that might not be important right now.) In one transaction, I'm trying to delete the old feature (I'd really like to update it, but haven't quite gotten that far) and add the two new features (the old line split into two new features). When I do this:
MsSql2008FeatureLayer layer = (MsSql2008FeatureLayer)winformsMap1.FindFeatureLayer("Highways");
...the feature I want to delete is being deleted, but the two new features are never added to the table. No errors, just no new records. I refresh the map and the original feature is gone but the two new ones are not. (If I do a COUNT(*) query before and after, the number decreases by 1 due to the deleted record, but should be increasing by 1 because I deleted 1 row and added two.) I have never added features through MapSuite before; we've always done it in code right to SQL Server. Anyone have any thoughts on why my records aren't being added? I thought perhaps a GID issue, but SQL Server will generate that, and then I thought perhaps an SRID issue I'd think the record would still be added to the table.
Thanks,
Allen
layer.FeatureSource.Open();
layer.FeatureSource.BeginTransaction();
layer.FeatureSource.DeleteFeature(args.AffectedVertexFeature.Id);
layer.FeatureSource.AddFeature(newFeature1);
layer.FeatureSource.AddFeature(newFeature2);
layer.FeatureSource.CommitTransaction();
layer.FeatureSource.Close();