Connect to database C#
Posted: Wed Oct 12, 2022 12:39 pm
Good Day,
I am attempting to connect to the database via C# code like:
Please advise what could be going wrong.
I am attempting to connect to the database via C# code like:
When attempting to run my report no data is returning, however when I embed the exact same connection string within the report itself and run the report from my code the data is returned. It appears that the connection string is not being used when passing it via the code method, I am using 2020.5.1 and will only be upgraded to the later version at the end of the year, early next.report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(new StiSqlDatabase("Connection", _configuration.GetConnectionString("ConnString")));
Please advise what could be going wrong.