UserControl and Connection String

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
DomenicoFormoso
Posts: 5
Joined: Sat 06 Oct 2018 14:42

UserControl and Connection String

Post by DomenicoFormoso » Tue 09 Oct 2018 13:32

I created a usercontrol (mycontrol1) containing a treeview that shows the data by dbcontext.
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>

use dot.connect for mysql ver8.12.1229.0

DomenicoFormoso
Posts: 5
Joined: Sat 06 Oct 2018 14:42

Re: UserControl and Connection String

Post by DomenicoFormoso » Wed 10 Oct 2018 09:34

My problem is not related to dotConnect but it is component programming.
For the moment I have excluded the data code at designtime.

Code: Select all

 if (!DesignMode)
            {..}
where

Code: Select all

protected bool IsInDesignMode
{
            get
            {
                return DesignMode || LicenseManager.UsageMode == LicenseUsageMode.Designtime;
            }
}
Thanks

Shalex
Site Admin
Posts: 8425
Joined: Thu 14 Aug 2008 12:44

Re: UserControl and Connection String

Post by Shalex » Fri 12 Oct 2018 12:43

If you encounter any provider-specific questions, feel free to contact us for getting assistance.

Post Reply