Adding new line or editing existing line on SQL table

Hi

I wonder if someone can tell me if I am on the right track.

I need to create new lines or edit existing lines that are stored in a geometry field on an sql database.

To create the new line I thought I could build up a new shape and then use SerializeToString and then use this to write to the sql database. It seems to have the x/y coords of each point in the string.Not sure if I need to extract these or if can be used as is. Using something similar to this
INSERT INTO SpatialTable (GeomCol1)
VALUES (geometry::STGeomFromText(‘LINESTRING (100 100, 20 180, 180 180)’, 0));

When creating a new line (a section of the road) I would also like to base it on the road lines. I assume for this I could get all the points on the road (using the SerializeToString) and build up the line from the point closest to where I had clicked for the start of the line and move along the line until I reach the end point that has been clicked

To edit the line I might add onto the end of the existing line or reduce the length of the line.

I assume the editing of shapes and saving them can only be done on shape files so in order to update to an sql table I would have to do the above. Is this correct?

Regards

Colleen Crawford

Hi Colleen,

Sorry for the very late reply.
Did you already looked at AxMap.AddLayerFromDatabase()?
It should give you access to the underlying shapefile-objects and edit them.