Hi Amritayan,
I just wonder what API you used for writing features back to a new shapefile, if you use the EditTools inside the ShapeFileFeatureLayer, you also can use the one inside the MsSql2008FeatureLayer store the features in database with the same code. If you use another way, please let me know, but I still recommend you to use EditTools because it’s easy to use that you don’t need know much knowledge of sql script.
There are three major methods in EditTools object, Add, Update and Delete. If you call Add and pass in a feature, it will insert the feature as a record to the sql table, if you call Update and pass in a feature, it will update the record with the same feature id with the one’s you pass in. if you call Delete and pass in a feature id, it will delete the record with the same feature id.
private void WriteFeaturesToFeatureLayer(IEnumerable<Feature> features, FeatureLayer featureLayer)
{
foreach (Feature feature in features)
{
featureLayer.Open();
featureLayer.EditTools.BeginTransaction();
featureLayer.EditTools.Add(feature);
featureLayer.EditTools.CommitTransaction();
featureLayer.Close();
}
}
Hope this code snippet can help you.
Thanks
James