在Stimulsoft Reports.Net运行时修改报表的连接字符串

时间:2023-03-10 02:01:26
在Stimulsoft Reports.Net运行时修改报表的连接字符串

怎么在Stimulsoft Reports.Net运行时修改报表的连接字符串?怎么改呀

C#

StiReport report = new StiReport();

report.Load("MyReport.mrt");

report.Dictionary.Databases.Clear();

report.Dictionary.Databases.Add(new StiSqlDatabase("MyDatabase", "new connection string"));

VB

Dim Report As New StiReport

Report.Load("MyReport.mrt")

Report.Dictionary.Databases.Clear()

Report.Dictionary.Databases.Add(New StiSqlDatabase("MyDatabase", "new connection string"))