Multidatabase

Multidatabase

Old forum URL: forums.lhotka.net/forums/t/691.aspx


phucphlq posted on Friday, July 21, 2006

I have a client application, a windows service and 2 similar databases(is named A, B).

When client choose database A, service will use database A to access data.

When client choose database B, service will use database B to access data.

How to do?

vargasbo replied on Friday, July 21, 2006

I uses something like...

Database db = DatabaseFactory.CreateDatabase(DatabaseProp.CustInfoNode);
db.ExecuteNonQuery("usp_SaveCustEmail", this.CustomerID, this.EmailSeqNum, this.EffDT.Date, this.EffStatus, this.EmailID, this.ChgID, this.ChgDT.Date, DateTime.Now);

In this Code example, CustInfoNode point to a specific database. DataBaseFactory.CreateDatabase, makes a call to a Com+ object, which goes out to an admin database to get the connection string for the specific database I wish to hit.

Regards,
      

Copyright (c) Marimer LLC