Change in runtime the external database connection

I'm trying to connect to two different databases with the same structure using the DatabaseConnection_SetConnectionStringForSession function

after using this action, we were unable to connect to the other database, it is still fetching data from the default database.

Note:

   - In the Studio Integration the entities changed [db1]. [Dbo]. [Table], for [table].

   - ConnectionName: <DB2 Connection Name>

   - ConnectionString: "Server = SERVER; Database = DB2; User Id = sa; Password = P;"

Hi,

I guess it is possible to create an extension and do it inside your extension by passing the details of the server and the data to be updated in run time.

Its just my suggestion..

you can only change the connection in a session when, for that session, you haven't used the existing database connection.

KR Hans

I tried to do it that way, but it didn't bring me the result of the second database, am I doing something wrong?