Page 1 of 1

How to Change Connection String using C# code in Window Forms

Posted: Thu Jul 19, 2018 1:26 pm
by alihassan
I have done with design reports using SQL Data Source in Designer view using our Local Environments. How we can change the Connection string run time for report Data Source in C# window forms application? Because of our client connection string changed, So please guide me about the connection string changes at RunTime from code?

Re: How to Change Connection String using C# code in Window Forms

Posted: Thu Jul 19, 2018 10:28 pm
by Lech Kulikowski
Hello,

You can use the following code:
((StiSqlDatabase)report.Dictionary.Databases[ "Connection"]).ConnectionString = "Your string";

Thank you.

Re: How to Change Connection String using C# code in Window Forms

Posted: Fri Jul 20, 2018 8:48 am
by alihassan
Fixed


Thanks.

Re: How to Change Connection String using C# code in Window Forms

Posted: Fri Jul 20, 2018 2:21 pm
by Lech Kulikowski
Hello

We are always glad to help you!
Please let us know if you need any additional help.

Thank you.