Skip to Content

Dynamically refreshing a trusted sql server connection on SQL Server 2012

I have a c# program that will correctly replace a trusted database connection the first time a report runs. When I select another database, and run the same code to replace the connection with the new database name, the database connection does not get updated with the latest database name. When the report completes, it still uses the first selected database connection. Thank you

Add comment
10|10000 characters needed characters exceeded

  • Hi Cherry, I am not sure what you mean by clearing the cache before hand, but my program is not a Web application, it is a windows desktop application. Each database connection is stored in row of a database. The row being retrieved is a function of what platform the report was originally designed on. I have my own parameter input screen that includes a database selection choice which I build on the fly. I am trying assign the last selected database connection dynamically to the report along with the last entered report parameters before assigning the report document to the crystal report component.

    Any further ideas since I provided more requirement to my project?

    Thank you

  • Get RSS Feed

1 Answer

  • May 22, 2018 at 01:14 AM

    Hi, Ben

    Have you changed the connection string to the remote database in the C# program?

    If the connection string is changed accordingly, please try to clear the cache before you run the report.

    Best regards,


    Add comment
    10|10000 characters needed characters exceeded