code is too database specific?

Posts   
 
    
lyndon_h
User
Posts: 79
Joined: 14-Sep-2004
# Posted on: 30-Sep-2004 16:51:14   

Please excuse the title. I meant to say that "code IS too database specific"

I have 2 sites that link to 2 different databases but share structure. I would like to use the same llblGen generated dlls for database access. But, I'm having a problem testing my application between the 2 databases. The error message I'm receiving is saying "Databasename.dbo.tablename" not found. How do I get share llblGen code amonst 2 dbs with the exact same structure?

thanks, lyndon

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39826
Joined: 17-Aug-2003
# Posted on: 30-Sep-2004 17:17:13   

Using adapter I suppose, as selfservicing doesn't generate the catalogname into the code. You can overwrite the catalog name to use in code or in the config file. Please see " Catalog specific persistence info (SqlServer specific)" in Using the generated code/Adapter/DataAccessAdapter functionality" in the documentation simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Fabrice
User
Posts: 180
Joined: 25-May-2004
# Posted on: 01-Oct-2004 12:16:21   

And if you want to override the dbowner, you have to override GetFieldPersistenceInfo method in a derived adapter. Otis, it's could be a usefull feature to allow to change the dbowner like the schemas, no ? Or it was allready possible and I'm just blinded simple_smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39826
Joined: 17-Aug-2003
# Posted on: 01-Oct-2004 12:35:36   

Fabrice wrote:

And if you want to override the dbowner, you have to override GetFieldPersistenceInfo method in a derived adapter. Otis, it's could be a usefull feature to allow to change the dbowner like the schemas, no ? Or it was allready possible and I'm just blinded simple_smile

No that isn't possible in the code, I didn't want to bloath the code with that option as well, as it isn't that common. You can rename a schema in the GUI though: rename the schema in the catalog explorer simple_smile

Frans Bouma | Lead developer LLBLGen Pro
lyndon_h
User
Posts: 79
Joined: 14-Sep-2004
# Posted on: 12-Oct-2004 02:47:22   

Thanks for the replies Frans and Fabrice. I haven't been able to get back to the forums in a lil bit. I didn't know i could just rename the catalog in the explorer. Thanks again

Posts: 497
Joined: 08-Apr-2004
# Posted on: 13-Oct-2004 11:52:48   

Frans,

Would you say theres a great benefit of doing this in the web.config file rather than setting it each time a DataAccessAdaptor is instantiated?

I guess the overhead is similar - either I find the Cactalog settings and pass them into the DataAcessAdaptor in my factory, or I leave it blank in which case the DataAccessAdaptor will look for these values..