Change connection string in code asp.net core mvc - not working
Posted: Mon Mar 04, 2019 6:17 pm
Hi - like many we need to change the connection string from dev environment to production.
We have looked at all the articles here are believe we only need to do this after the "Report" is loaded :-
But the reports are blank! We have tried using this technique for exactly the same connection string we are using with the Report Builder, with same blank results.
If we don't use any of the above code, the reports work fine in the dev environment.
Please could someone assist.
Thanks.
We have looked at all the articles here are believe we only need to do this after the "Report" is loaded :-
Code: Select all
report.Load(...);
connectionString = "Data Source=SQLSERVERNAME;Initial Catalog=LotsOfLovelyData;Integrated Security=False;User ID=sa;Password=shhhSecret";
report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("LotsOfLovelyData", connectionString));
If we don't use any of the above code, the reports work fine in the dev environment.
Please could someone assist.
Thanks.