> The fix is to add a DbLinqProvider=MySql parameter:
>
>         var dbcon = new MySqlConnection(
>                 "Server=localhost;" +
>                 "Database=MySqlSampleDb;" +
>                 "User=user; Password=Password;" +
>                 "DbLinqProvider=MySql");
>         ...

MySql does not like the "DbLinqProvider" option pass to its
MySqlConnection().  It gave me an error complaining that it was not a
valid MySql connection option.  However, passing the connection string
to the generated DataContext as shown below worked.

var db = new MySqlSampleDb("DbLinqProvider=MySql; " +
                                
"DbLinqConnectionType=MySql.Data.MySqlClient.MySqlConnection,
MySql.Data, Version=6.3.4.0, Culture=neutral,
PublicKeyToken=c5687fc88969c44d; " +
                                "Server=localhost; Database=MySqlSampleDb; 
User=user;
Password=password;")

Thanks much for your kind assistance.
-El


On Sep 23, 2:18 pm, Jonathan Pryor <[email protected]> wrote:
> On Thu, 2010-09-23 at 10:42 -0700, El wrote:
> > Thanks.  It worked.  My project compiles.  But running it caused an
> > error:
>
> > Unhandled Exception: MySql.Data.MySqlClient.MySqlException: ...
> ...
> > Here's my simple test code:
> ...
> >                    dbcon = (IDbConnection) new 
> > MySqlConnection("Server=localhost;
> > Database=MySqlSampleDb; User=user; Password=password;");
>
>        http://code.google.com/p/dblinq2007/wiki/Installation#To_use_DbLinq
>
> Your problem is that your connection string is missing the
> DbLinqProvider parameter.  Consequently DbLinq assumes you're targeting
> Microsoft SQL Server, and thus produces MSSQL-style SQL instead of
> MySQL-style SQL.
>
> The fix is to add a DbLinqProvider=MySql parameter:
>
>         var dbcon = new MySqlConnection(
>                 "Server=localhost;" +
>                 "Database=MySqlSampleDb;" +
>                 "User=user; Password=Password;" +
>                 "DbLinqProvider=MySql");
>         ...
>
>  - Jon

-- 
You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/dblinq?hl=en.

Reply via email to