How to Change Connection String using C# code in Window Forms
How to Change Connection String using C# code in Window Forms
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?
-
- Posts: 6245
- Joined: Tue Mar 20, 2018 5:34 am
Re: How to Change Connection String using C# code in Window Forms
Hello,
You can use the following code:
((StiSqlDatabase)report.Dictionary.Databases[ "Connection"]).ConnectionString = "Your string";
Thank you.
You can use the following code:
((StiSqlDatabase)report.Dictionary.Databases[ "Connection"]).ConnectionString = "Your string";
Thank you.
-
- Posts: 6245
- Joined: Tue Mar 20, 2018 5:34 am
Re: How to Change Connection String using C# code in Window Forms
Hello
We are always glad to help you!
Please let us know if you need any additional help.
Thank you.
We are always glad to help you!
Please let us know if you need any additional help.
Thank you.