Using two different DALs with LLBL

Posts   
 
    
daz_oldham avatar
daz_oldham
User
Posts: 62
Joined: 20-Jul-2007
# Posted on: 13-Jun-2009 18:22:25   

Hello all

I have been using LLBL for a while now and have built quite a nice CMS for my customers using this as my data access layer.

I now want to connect to a separate database with another LLBL DAL, but I don't want to have to re-compile my main DAL to do this... and both the instances will have their own connection string and live in their own namespace.

Is there any way to do this and in effect have:

Main.ConnectionString Second.ConnectionString

In my web.config?

Thanks all in advance

Darren smile

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 14-Jun-2009 19:55:24   

So, you have two different LLBLGen projects, that generates two different generated codes (DAL). Then you want to use that two DAL in one project, each DAL have its own namespace and connectionString. Is that right?

Yes, is possible, you olny need to: 1. Change **ConnectionStringKeyName **property on Project Properties at LLBLGen Designer, for each DAL project. One will be set to "Main.ConnectionString" and the other to "Second.ConnectionString".

  1. The same above but with the property RootNamespace.
David Elizondo | LLBLGen Support Team
daz_oldham avatar
daz_oldham
User
Posts: 62
Joined: 20-Jul-2007
# Posted on: 14-Jun-2009 20:46:16   

That's great - thanks David smile

My current namespace is RedStarCreative.DAL so I think I'll go for both so that I also have RedStarCreative.DAL.Custom.PROJECTNAME - that way everything is nice and uniform.

Still loving LLBL!!

Darren