It works fine if I use it dynamically (I create it in the form this.control.add(mycontrol1)).
But if I use mycontrol1 at design time I get the error: Connection string "xxx" could not be found in the configuration file.
here is my app.config:
Code: Select all
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="xxx" connectionString="User Id=xxx;Password=yyy;Host=server;Database=gestio;Persist Security Info=True" />
<add name="yyy" connectionString="User Id=yyy;Password=yyy;Host=server2;Database=saol3;Persist Security Info=True" />
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>