Programmically Connecting to Multiple Databases using Same BOs


Author
Message
Jeff Pagley
Jeff Pagley
Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893

Hi SF Team,

I have an unusual challenge I need some help on.  I will be creating new databases with thesame schema on a regular basis on the same server.  Therefore, I will not only have existingdatabases, but I will constantly have new ones. Within one single application I need to be able to randomly select  any four of these databases and in some wayuse the same BO classes to connect and CRUD to each database.  Any suggestions on how I might be able to dothis? 

Thanks,

Jeff 


Replies
Jeff Pagley
Jeff Pagley
Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
Thanks Edhy for the reply.  I use the Connection Manager now. But I need to clarify what I want to do.  I need to have 4 connectionsopen at the same time to 4 different databases within the same application andthen have the BOs use those 4 connections for CRUD operations.  Is this possible?

Jeff


Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Jeff Pagley (6/16/2011)
Thanks Edhy for the reply.  I use the Connection Manager now. But I need to clarify what I want to do.  I need to have 4 connectionsopen at the same time to 4 different databases within the same application andthen have the BOs use those 4 connections for CRUD operations.  Is this possible?

Yes, you can have as many connections open as you want.  In the AppMain.vb or Program.cs add a data source item in the SetDataSources method for each database.  Make sure you fill the DataSourceKey parameter for each one, then you can set the BO.DataSourceKey to use the connection you want to get the data from.

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search