// 得到选中的数据集
soDataSource pDataSource = axSuperWorkspaceCtl.Datasources[strDataSource];
soDataset pDataset = pDataSource.Datasets[strDataset];
if (pDataset != null)
{
// 添加数据集
soLayers pLayers = axSuperMapCtrl.Layers;
//pLayers.RemoveAll();
pLayers.AddDataset(pDataset, true);
// 刷新地图
axSuperMapCtrl.Refresh();
axSuperLegendCtrl.Refresh();
// 释放com接口资源
Marshal.ReleaseComObject(pLayers); pLayers = null;
}
Marshal.ReleaseComObject(pDataset); pDataset = null;
Marshal.ReleaseComObject(pDataSource); pDataSource = null;