I have followed this example:
but, in my opinion, it doesn't work properly.
I have two featureclass in the same GDB, and a layer on the map has source GDB\featureclass1. I change the DataSource of the layer using the code in the example so that the new DataSource is GDB\featureclass2.
When I delete GDB\featureclass1 the layer is removed from the map, I'm wandering why this is happening because now its DataSource is changed.