Hi,
I want to change the SQL Connection (that is already exists in the mrt file) dynamically by .Net code.
I tried:
report.Dictionary.DataSources.Clear();
report.Dictionary.DataSources.Add(new StiSqlSource("DBConnection", hhh.ConexaoAtiva.ConnectionString));
But not work.
Could you help-me?
Thanks
Rafael Mello
Change SQL connection dynamically (data sources)
-
- Posts: 10
- Joined: Wed Oct 30, 2013 3:52 pm
Change SQL connection dynamically (data sources)
- Attachments
-
- sqlconn.jpg (111.13 KiB) Viewed 1614 times
Re: Change SQL connection dynamically (data sources)
Hello,
Please try to use the following code:
or
Thank you.
Please try to use the following code:
Code: Select all
((StiSqlDatabase)report.Dictionary.Databases["DBConnection"]).ConnectionString = hhh.ConexaoAtiva.ConnectionString);
Code: Select all
report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("DBConnection", hhh.ConexaoAtiva.ConnectionString));
-
- Posts: 10
- Joined: Wed Oct 30, 2013 3:52 pm
Re: Change SQL connection dynamically (data sources)
Thank you Aleksey, your code works fine!
best regards
Rafael Mello
best regards
Rafael Mello
Re: Change SQL connection dynamically (data sources)
Hello,
We are always glad to help you!
We are always glad to help you!