two catalogs, two different sql servers, connection string?

Posts   
 
    
Posts: 29
Joined: 05-Sep-2005
# Posted on: 05-Sep-2005 14:25:44   

Hello All,

I am getting stumped and not sure what to try.

I have two catalogs, very similar, that are on two different sql servers. The point of the program will be to synchronize the two catalogs. Call the first catalog DBBase on SQLBase server and the second catalog DBRemote on SQLRemote server.

I would like to generate two different LLBL projects, one for each catalog so I can use the library in other programs - easy enough as this is standard usage for LLBL. I now end up with DBBase.DataLayer and DBRemote.DataLayer, both having identical app.config files, but with separate catalog names and separate connection strings.

Now, I need to create a third library that includes both of these catalog libraries in order to read from DBBase catalog and write the data to DBRemote catalog. Call the library DBBase.Synch.

How do I setup the app.config file so that I have a connection string for DBBase and a connection string for DBRemote? My preference is using the SelfServicing two class scenario, but as we just saw, I have two identical app.config files with different values. How does DBBase.Synch distinguish between the connection strings?

Note that the catalogs are similar, but the entities are not exactly the same. I.e., the table Table1 in DBBase uses the field dbID as the identity field and the table Table1 in DBRemote uses the field dbID as an integer field. My program will then read dbID in DBBase and write the value in dbID in DBRemote. Also, Table1 in DBBase has more fields than Table1 in DBRemote because some fields are irrelevant for DBRemote.

Thanks for any ideas - I'm stumpedsimple_smile

David.

Posts: 29
Joined: 05-Sep-2005
# Posted on: 05-Sep-2005 14:34:50   

Hmmm.

Looks like I accidentally stumbled on what might be the answer. It looks like we can change the name of the connection string in the project properties.

Thus, in DBBase project we could call the connection string Base.ConnectionString and in DBRemote, Remote.ConnectionString. Then the app.config files would simply have two variables for the connection string and DBBase.Synch would be able to pull the correct one for each table.

I'll give it a try. I'd love to hear a confirmation that this works.

David.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 06-Sep-2005 10:34:20   

That's the purpose of giving a name to the key for the connection string indeed: so you can have multiple projects in your application using the same .config file simple_smile

Frans Bouma | Lead developer LLBLGen Pro