user1238321
user1238321

Reputation: 249

Change connection string petapoco

I have 2 separate databases which I'm wanting to merge to be shared by one site. When someone logs in I have a check to see if the user exists in database one, if they aren't I check database 2, if they are in that database I want to switch to default connection string to database 2. The petapoco database is has auto-generated code it says not to change. so is this possible?

Upvotes: 1

Views: 3580

Answers (1)

Eduardo Molteni
Eduardo Molteni

Reputation: 39443

The PetaPoco Database object has 4 constructors:

    public Database(IDbConnection connection)
    public Database(string connectionString, string providerName)
    public Database(string connectionString, DbProviderFactory provider)
    public Database(string connectionStringName)

Use Database(string connectionString, string providerName) if you want to provide the connection string.

Upvotes: 1

Related Questions