Hi all,
i have a problem in editing and saving of shapes. In the response i got before, there was an attached demo file that allows users to draw and then save shapes using MsSqm2008FeatureSource:
gis.thinkgeo.com/Support/Dis...fault.aspx
when you first run the test, all shapes were drawn and saved well, but as i dig deeper into shapes, i encounter error and spent a wholeday scratching my head. Please try if you can recreate my problem:
1. Draw 2 shapes and save (the SQL file now has 2 rows), exit the program
2. Run the program again, press the "Load" button, the 2 shapes you drawn before was shown successfully
3. Draw a new (3rd) shape, then Save. The error "2 failed" appears. When you run again and load, all 3 shapes are there, so it means the two previously drawn shapes were not saved because they already exist in SQL file.
4. Now there 3 shapes on screen, also 3 rows in SQL file, try to add another (4th) shape, but before you save, empty the SQL file so all 4 shapes will be saved without problem. But when you hit "Save", error message "3 failed", eventhough the SQL file is empty. The row in SQL file is 1 (only the newly drawn was saved), and i checked the number of winformsMap1.TrackOverlay.TrackShapeLayer.InternalFeatures.Count, it was 4.
In other words, when we call featureSource.CommitTransaction(), only the newly drawn shapes were saved although all shapes were present in InternalFeatures of a TrackShapeLayer. What am i missing here?
Ric