English
Bug Number NIM058287
Submitted Jun 14, 2010
Modified Jun 11, 2020
Severity Medium
Applies To No Product Found
Version Found 9.3.1
Prog Language C#
Server Platform
Client Platform
Database N/A
Locale N/A
Status In Product Plan
Version Fixed
SP Fixed

Bug NIM058287

Synopsis

IDataLayer fails in changing login info for a RasterLayer.


Additional Information

N/A


Alternate Solution

Instead of changing the connection parameters in IDataLayer.DatasourceName for changing the workspace, the new raster / raster catalog is opened from the new Workspace with IRasterWorkspaceEx.OpenRasterDataset(<a href="http://oldDatasetName.Name" target="_blank">oldDatasetName.Name</a>) or IRasterWorkspaceEx.OpenRasterCatalog(<a href="http://oldDatasetName.Name" target="_blank">oldDatasetName.Name</a>). The return value is used to set IDataLayer.DatasourceName.


private static void SpecialTreatmentForRasterData(ref IDatasetName datasetName)

{

IRasterWorkspaceEx newWorkspaceAsRasterWorkspaceEx = ((IName)datasetName.WorkspaceName).Open() as IRasterWorkspaceEx;

if (newWorkspaceAsRasterWorkspaceEx != null

&& (datasetName.Type == esriDatasetType.esriDTRasterDataset

|| datasetName.Type == esriDatasetType.esriDTRasterCatalog))

{

IDataset newDataset =

datasetName.Type == esriDatasetType.esriDTRasterDataset

? (IDataset)newWorkspaceAsRasterWorkspaceEx.OpenRasterDataset(<a href="http://datasetName.Name" target="_blank">datasetName.Name</a>)

: (IDataset)newWorkspaceAsRasterWorkspaceEx.OpenRasterCatalog(<a href="http://datasetName.Name" target="_blank">datasetName.Name</a>);

datasetName = (IDatasetName)newDataset.FullName;

}

}