Hello. I have a report that wants to run a query against three tables. Jobs and xtblProjects are in database A and p21_view_customer is in database B. The report file has already been written and if I preview it in Visual Studio it's fine. My problem is when I run my C# application. I was getting "The table 'p21_view_customer' could not be found." I fixed that, and now my report is blank :/.

These are the things I've been trying. I have a routine called SetupForTheReport() that is called to loop through the report tables and set the logon info. The logon info was always database A and then I hit this report that also wanted to use database B. So I thought this logic would help:
Code:
        private void SetupForTheReport(string filenameOfReport)
        {
            ConnectionInfo crConnectionInfo = new ConnectionInfo();
            crConnectionInfo.ServerName = "nn.nn.nn.nn";
            crConnectionInfo.DatabaseName = "Database A";
            crConnectionInfo.IntegratedSecurity = true;

            crReport = new ReportDocument();
            crReport.Load(filenameOfReport);

            Tables crTables;
            TableLogOnInfo crTableLogonInfo = new TableLogOnInfo();
            crTables = crReport.Database.Tables;
            foreach (Table crTable in crTables)
            {
                if (crTable.Name == "p21_view_customer")
                {
                    ConnectionInfo crConnectionInfoP21 = new ConnectionInfo();
                    crConnectionInfoP21.ServerName = "nn.nn.nn.nn"; // It's the same server as above
                    crConnectionInfoP21.DatabaseName = "Database B";
                    crConnectionInfoP21.IntegratedSecurity = true;

                    crTableLogonInfo = crTable.LogOnInfo;
                    crTableLogonInfo.ConnectionInfo = crConnectionInfoP21;
                    crTable.ApplyLogOnInfo(crTableLogonInfo);

                    crConnectionInfoP21 = null;
                }
                else
                {
                    crTableLogonInfo = crTable.LogOnInfo;
                    crTableLogonInfo.ConnectionInfo = crConnectionInfo;
                    crTable.ApplyLogOnInfo(crTableLogonInfo);
                }
            }
        }
But no, same error that the table couldn't be found.

Then in Visual Studio, I started scrutinizing the report and in Field Explorer under Database Fields the three tables are listed. They were all pointing to Database A. Now it does look like p21_view_customer is correctly saying Catalog: Database B. But still, table couldn't be found. (This didn't make sense to me because the preview worked in Visual Studio and how could it have if the Catalog of the Database B table was pointing to Database A?)

Then I found a tutorial on YouTube and I changed datasources...it really seemed like I was just redoing things I'd already done, but a new sql query was generated. It has two parts. Part 1 selects from Jobs and xtblProjects in A and the second part selects from p21_view_customer in B. And it looks like they get connected by "EXTERNAL JOIN", and that is giving me the blank report. I don't know if this is progress because it found the table finally and I just have debug why it's blank?

So my question is, isn't there a straightforward way to run a query against tables in 2 databases that are on the same server?