As described in the documentation:
By default, the extent of database layers is set to (-180,90,180,-90) (units are decimal degrees). The coordinate system is set to WGS 1984 (EPSG/SRID code is 4326).
If only database layers are added - the extent should be set, otherwise the layers will not visible.
If the layer is added only to query for the shapes inside the layer, you do not need to set the extent, and it is better to use the Layer.Open method for this purpose.
Regarding the old AddShapeDataLayer method, it is obsolete but still is supported. If the AddShapeDataLayer is used, the extent also must be set (the Map.FullExtent method was used in the previous versions for this purpose).