Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gordon Saxby 1444 posts 1855 karma points
    Mar 21, 2014 @ 11:29
    Gordon Saxby
    0

    SQL Checkbox List with MySQL

    I want to use the SQL CheckboxList control to connect to a another database (not the Umbraco one), which is on a remote server and is MySQL 5.6

    I am using Umbraco v6.1.6 and uComponents 6.0.0

    I created the control, selected the connection string and entered the SQL statement. However, when I try to access a node with the control on it I get an error "SqlException (0x80131904): Login failed for user" ... but all the error message content is about "System.Data.SqlClient" ?

    My connection string is like :

    <add name="xxxDbDSN" connectionString="Server=networkserverxxx;Database=dbname;Uid=username;Pwd=password" providerName="MySql.Data.MySqlClient" />

     

     

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Mar 21, 2014 @ 13:26
    Hendy Racher
    0

    Hi Gordon,

    Just had a quick look at the source, and it's going via the Umbraco SqlHelper, I wonder, is your main Umbraco database using MS SQL ?

  • Gordon Saxby 1444 posts 1855 karma points
    Mar 21, 2014 @ 13:27
    Gordon Saxby
    0

    Yes, Umbraco DB is SQL Server 2012. External data source DB is MySQL 5.6

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Mar 21, 2014 @ 14:22
    Hendy Racher
    0

    Hi, looking though the Umbraco 6.1.6 source, it looks like it'll default to SqlServer unless a datalayer= is found in the connection string. I wonder if the following would work ?

    <addname="xxxDbDSN"connectionString="Server=networkserverxxx;Database=dbname;Uid=username;Pwd=password;datalayer=MySql.Data.MySqlClient,MySql.Data"/>

     

  • Gordon Saxby 1444 posts 1855 karma points
    Mar 21, 2014 @ 15:00
    Gordon Saxby
    0

    I now get this

    Could not load type 'MySql.Data.MySqlClient' from assembly 'MySql.Data, Version=6.6.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d'.

     

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Mar 21, 2014 @ 15:13
    Hendy Racher
    100

    how about:

    <addname="xxxDbDSN"connectionString="Server=networkserverxxx;Database=dbname;Uid=username;Pwd=password;datalayer=MySql"/>
  • Gordon Saxby 1444 posts 1855 karma points
    Mar 21, 2014 @ 15:18
    Gordon Saxby
    1

    That worked - thanks Hendy :-)

  • Gordon Saxby 1444 posts 1855 karma points
    Apr 10, 2014 @ 13:37
    Gordon Saxby
    0

    I suspect this is still causing me trouble!

    I have it connected to a MySQL database and it retrieves data ... and I am displaying it OK.

    The problem is there seems to be a clash - or something with "Google maps for Umbraco". Individually they work fine, but if you click on a node that contains one (uComponent SQL Dropdown or Google Map) then at some point click on a node that contains the other ... it crashes. The error is:

    Unable to connect to any of the specified MySQL hosts.

    Of course, it is possible that it is the node containing Google Maps that is causing the problem, but that doesn't use the MySQL database (none of the datatypes on the node do).

    Any clues?

  • Gordon Saxby 1444 posts 1855 karma points
    Apr 10, 2014 @ 15:24
    Gordon Saxby
    0

    makes for a fun day when you get to try something new ...

    To solve the "issue" I added the MySQL database to the SQL Server as a "Linked Server". Then I changed the connection string to the normal Umbraco / SQL one and used "openquery" to get the necessary data. Works a treat :-)

Please Sign in or register to post replies

Write your reply to:

Draft