Binding two different databases in single application

Posts   
 
    
amit
User
Posts: 8
Joined: 15-Feb-2007
# Posted on: 16-Feb-2007 05:00:04   

I am developing an application in VS 2005 where I need to my application talking to MS Access
database and Interbase database at the same time.

** config.app 1**

<?xml version="1.0"?> <configuration> <appSettings> <add key="Main.ConnectionString" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=U:\db.mdb;User Id=;Password=;Jet OLEDB:System Database=;Jet OLEDB:Database password=stick"/> </appSettings> </configuration>

config.app 2

<?xml version="1.0"?> <configuration> <appSettings> <add key="Main.ConnectionString" value="Database=\SUPERPLUS;DataSource=limms;User=sysdba;Password=xyzzy;Port=3050;Role=;CharSet=UNICODE_FSS"/> </appSettings> </configuration>

what changes do i have to make to my App.config file to allow both the database to be accessed simultaneously.

Thanks!

amit
User
Posts: 8
Joined: 15-Feb-2007
# Posted on: 16-Feb-2007 05:13:19   

JimHugh
User
Posts: 191
Joined: 16-Nov-2005
# Posted on: 16-Feb-2007 07:48:27   

In the Project | Properties, change the ConnectionStringKeyName for one of the two Projects from Main.ConnectionString to something else, maybe "Access.ConnectionString"

Regenerate and rebuild that project. Then the combined app.config would look like this:


<?xml version="1.0"?>
<configuration>
    <appSettings>
        <add key="Access.ConnectionString" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=U:\db.mdb;User Id=;Password=;Jet OLEDB:System Database=;Jet OLEDB:Database password=stick"/>
        <add key="Main.ConnectionString" value="Database=\SUPERPLUS;DataSource=limms;User=sysdba;Password=xyzzy;Port=3050;Role=;CharSet=UNICODE_FSS"/>
    </appSettings>
</configuration>

amit
User
Posts: 8
Joined: 15-Feb-2007
# Posted on: 16-Feb-2007 07:57:33   

I just got it working.

Thanks a lot for all your Help!!!