tprohas wrote:
Otis wrote:
how are you using the catalog name overwriting? Through setting an adapter property or using config file settings?
I'm using sqlServerCatalogNameOverwrites tag in the config file.
You then could read them using:
NameValueCollection catalogOverwriteDefinitions = (NameValueCollection)ConfigurationSettings.GetConfig("sqlServerCatalogNameOverwrites");
if(catalogOverwriteDefinitions!=null)
{
for(int i=0;i<catalogOverwriteDefinitions.Count;i++)
{
string key = catalogOverwriteDefinitions.GetKey(i);
string value = catalogOverwriteDefinitions.Get(i);
if(_catalogOverwrites.ContainsKey(key))
{
continue;
}
_catalogOverwrites.Add(key, value);
}
}
(code from sqlserver DQE)
And use it as you want. You can also ask the DQE for the new name if you have the old name:
string newName = SD.LLBLGen.Pro.DQE.SqlServer.DynamicQueryEngine.GetNewCatalogName(oldName);
which is prefered, as you then don't have to fiddle with the config file settings. If you're using adapter, the best place for this kind of code is in a derived class from DataAccessAdapter, as that class has access to the DQE, so your own code doesn't have to