Setting ODBC connection dynamically in C# for Crystal Reports
Posted on 2010-11-13
I'm using C# 4.0. I have a CR report that uses an ODBC connection called Reports. I want to change that dynamically in C# so that I can point to the database I want at run time.
Here's the problem. The register entry of interest is
I changed the DATABASE field value from OldDB to NewDB. When I go to the CR designer in VS, choose Database Expert and then under My Connections browse the contents of the connection Reports, it pulls up OldDB.
Apparently My Connections binds to an ODBC connection at design time. I can set up a new connection to Reports and it shows up in My Connections as Reports1.