Hi Ratnesh
In our work environment, we have different 'development' versions of an application and sometimes I have to test in one and sometimes in another. The applications are essentially the same but have a different application names and access different underlying databases so generating a name mapping file for one application will really only work with that application.
The workaround I used was to create different name mapping configurations (see 'Name Mapping Configurations' in the help file). I can then call an initialisation script which determines which version of the application is running and selects the associated name mapping file, something along the following lines:
if (NameMapping.Sys.WaitProcess("<your application name>", 1000).Exists)
{
NameMapping.CurrentConfiguration = "<associated name mapping configuration>";
}
...
NameMapping.Sys.<your application name>.RefreshMappingInfo();
I hope this will be of some assistance.
Regards
Stephen.