The selected connection string is invalid!

2 posts, 0 answers
  1. Mattias Engman
    Mattias Engman avatar
    1 posts
    Member since:
    Jun 2005

    Posted 06 Dec 2009 Link to this post

    I just installed openaccess and tries to enable my project to use ORM in the Telerik menu in VS 2010.. I'm trying to connect to MySql by setting a custom defined connection string in the "enable project wizard", but only gets the alert message "The selected connection string is invalid!". I have tried all different connection string format I can think of, but still the same message... Should not the connection string look like this? "; userid=xxxxx; password=xxxxxxxxx; database=dbname;"

    Thanks for help
  2. Alexander
    Alexander avatar
    727 posts

    Posted 10 Dec 2009 Link to this post

    Hello Mattias Engman,

    It seems the MySql .NET Connector does not work with Visual Studio 2010 yet. That is why you are not able to set the connection string via the wizard as it requires a working database provider. However, you should be able to set the connection string manually in the config file. In the Enable project wizard set a connection to a database on the local SqlExpress server so the wizard will generate a configuration file with an <openAccess> section. Then edit just the connection strings to look like this:
        <section name="openaccess" type="Telerik.OpenAccess.Config.ConfigSectionHandler, Telerik.OpenAccess.Config, Version=, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342" requirePermission="false" />
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
        <add name="DatabaseConnection1" connectionString="server=localhost; userid=user; password=1234; database=test" providerName="MySql.Data.MySqlClient" />
      <openaccess xmlns="">
        <references />
          <connection id="DatabaseConnection1">
            <connectionString>server=localhost; userid=user; password=1234; database=test</connectionString>
          <backendconfiguration id="mysqlConfiguration" backend="mysql">
        <mappings current="mysqlMapping">
          <mapping id="mysqlMapping" />
    Note that you have to change the connection string at two places, set "MySql.Data.MySqlClient" for providerName and change the "backend" attribute to "mysql". The places where you should do the changes are in bold style above. You may also have to add a reference to the assembly which can be found in the <OpenAccess install path>\bin directory. Hope that helps.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top