Using system.db.execSProcCall

I have two databases and accordingly there are two database connections configured in the project.
One db connection is configured as a defualt connection in the project.

In one of the windows, I would like to generate a dataset for use with a bar chart. I am using the ‘system.db.execSProcCall’ to run the stored procedure and generate the dataset. The problem I am having is the stored procedure/data resides in the database that is not associated with the default connection of the project. How can I specify the connection the program needs to use when calling this stored procedure? In some of the property window, I have see there is an option which db connection the event handler should use. But I do not see that option in the script window. I did not find any functions which I can use to specify the connection. I appreciate any help on how to resolve this issue

You just need to specify the database name when you create the SProcCall object.

call = system.db.createSProcCall("theNameOfYourQuery", "DatabaseName")
system.db.execSProcCall(call)

Don’t forget that the user manual details all of the possible parameters for each scripting function.