Is this with the mono bundled dblinq or the download at google code?
Regards,
James Darbyshire
Sent from my Samsung Droid™
--
You received this message because you are subscribed to the Google Groups "DbLinq" group.
To post to this group, send email to dbl...@googlegroups.com.
To unsubscribe from this group, send email to dblinq+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dblinq?hl=en.
Not sufficient. sqlmetal is, for all intents and purposes, DbMetal,
thus the following applies:
http://code.google.com/p/dblinq2007/wiki/Installation#To_run_DbMetal
Specifically the "There are three ways that the ADO.NET provider can be
used with DbMetal.exe" section:
If your ADO.NET provider is present within the Global Assembly
Cache, you can edit DbMetal.exe.config (in the DbLinq
installation directory) to use an assembly-qualified type name
in the /configuration/providers/provider/@databaseConnection
attribute.
The default ADO.NET provider for MySQL is the ByteFX.Data provider. The
advantage is that ByteFX is bundled with Mono, but it's also ancient
(hence your authentication error). Thus, you should edit
e.g. /usr/lib/mono/2.0/sqlmetal.exe.config and change the MySQL provider
value. Alternatively...
> I saw some links that
> suggested adding the /databaseConnectionProvider.
>
> sqlmetal /provider:MySql /
> databaseConnectionProvider="MySql.Data.MySqlConnection, MySql.Data" /
> server:localhost /database:MySqlSampleDb /user:hansel /
> password:rpt4wr5 /debug /pluralize /code=mysqlsampledb.cs
If your mono is anything recent, it's not /databaseConnectionProvider,
it's --with-dbconnection. See 'sqlmetal /?' for details.. Furthermore,
the value needs to be a fully qualified name, which yours isn't. Thus:
sqlmetal /provider:MySql \
--with-dbconnection="MySql.Data.MySqlClient.MySqlConnection, MySql.Data, Version=5.0.8.1, Culture=neutral, PublicKeyToken=c5687fc88969c44d" \
/server:localhost /database:MySqlSampleDb \
/user:user /password:password /debug /pluralize \
/code:mysqlsampledb.cs
Note that the above value comes from MySql.Data v5.0.8.1, so things may
have changed [0].
- Jon
[0] Pro tip: to easily get the assembly qualified name,
use /usr/bin/csharp:
$ csharp -r:path/to/MySql.Data.dll
csharp> typeof(MySql.Data.MySqlClient.MySqlConnection).AssemblyQualifiedName;
"MySql.Data.MySqlClient.MySqlConnection, MySql.Data, Version=5.0.8.1, Culture=neutral, PublicKeyToken=c5687fc88969c44d"
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