In the COM API you can specify the target database you want to run a query against using CreateQueryObj. For example CRM.CreateQueryObj ("select * from mytable","MYDB"). This uses the Advanced Customization->Tables and Databases->Database connection.
Is there an equivalent in the .Net API? The QuerySelect object doesn't seem to support this.