How to remove catalog name from sp calls?

Posts   
 
    
SaX
User
Posts: 42
Joined: 29-Apr-2004
# Posted on: 12-Jul-2005 11:30:40   

We are using adapter scenario an the latest version of the llbl. We have 3 SQLserver databases (COMMODO, COMMODO2, COMMODO_TEST) that have identical structure and I would like to use single DatabaseSpecific project for all of them. Problem is that in my DatabaseSpecific project calls to stored procedures have hardcoded catalog name:


public static int AzurirajNabavneCijeneNaPRS(System.Decimal dkm_Id, DataAccessAdapter adapter)
{
// create parameters
SqlParameter[] parameters = new SqlParameter[1];
parameters[0] = new SqlParameter("@Dkm_Id", SqlDbType.Decimal, 0, ParameterDirection.Input, true, 15, 0, "",  DataRowVersion.Current, dkm_Id);

// Call the stored proc.
int toReturn = adapter.CallActionStoredProcedure("[COMMODO].[dbo].[dkspAzurirajNabavneCijeneNaPRS]", parameters);

return toReturn;
}

I would like to know if there is a way to create a database specific projec that would work on all three of my databases...

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 12-Jul-2005 11:42:53   

Use catalog name overwriting, either through the config file (see "Application configuration through .config files") or by passing in a name and setting per DataAccessAdapter instance (see: adapter/ "DataAccessAdapter Functionality")

Frans Bouma | Lead developer LLBLGen Pro