Changing connection string
Posted: Mon Mar 17, 2014 9:50 am
In report I can add connection to sql.
My question is - Is it possible to change connection string for this connection in code?
For example:
In report I add connection with connection string "Data Source=(local);Integrated Security=True;Initial Catalog=Test".
Is it possible to change this connection string on "Data Source=(local);Integrated Security=True;Initial Catalog=Test2" in code?
I have code like this:
and I was looking for any public property with connection string in object "dataSource" but I couldn't find (I found one private property, but couldn't change it).
Is it possible to achieve what I want?
Thank you in advance for your help.
My question is - Is it possible to change connection string for this connection in code?
For example:
In report I add connection with connection string "Data Source=(local);Integrated Security=True;Initial Catalog=Test".
Is it possible to change this connection string on "Data Source=(local);Integrated Security=True;Initial Catalog=Test2" in code?
I have code like this:
Code: Select all
StiReport r = new StiReport();
r.Load("Report.mrt");
var dataSources = r.Dictionary.DataSources
Is it possible to achieve what I want?
Thank you in advance for your help.