'binary' datatype not being mapped

1 view
Skip to first unread message

mikcy

unread,
Nov 8, 2009, 2:34:08 AM11/8/09
to DbLinq
Hallo,

I just started using DBMetal yesterday and i was trying to produce c#
and dbml files for a MySql database that uses the binary datatype and
i noticed that it isn't available, for some reason, as is shown below:

DbMetal failed:System.ArgumentException: Don't know how to convert the
SQL type
'binary' into a managed type.
Parameter name: dataType
at DbLinq.Vendor.Implementation.SchemaLoader.MapDbType(String
columnName, IDa
taType dataType) in C:\Documents and Settings\Administrator\My
Documents\Visual
Studio 2008\Projects\DbLinqLatest\src\DbLinq\Vendor\Implementation
\SchemaLoader.
TypeMapping.cs:line 216
at DbLinq.Vendor.Implementation.SchemaLoader.LoadColumns(Database
schema, Sch
emaName schemaName, IDbConnection conn, INameAliases nameAliases,
NameFormat nam
eFormat, Names names) in C:\Documents and Settings\Administrator\My
Documents\Vi
sual Studio 2008\Projects\DbLinqLatest\src\DbLinq\Vendor\Implementation
\SchemaLo
ader.cs:line 430
at DbLinq.Vendor.Implementation.SchemaLoader.Load(String
databaseName, INameA
liases nameAliases, NameFormat nameFormat, Boolean
loadStoredProcedures, String
contextNamespace, String entityNamespace) in C:\Documents and Settings
\Administr
ator\My Documents\Visual Studio 2008\Projects\DbLinqLatest\src\DbLinq
\Vendor\Imp
lementation\SchemaLoader.cs:line 122
at DbMetal.Generator.Implementation.Processor.ReadSchema(Parameters
parameter
s, ISchemaLoader& schemaLoader) in C:\Documents and Settings
\Administrator\My Do
cuments\Visual Studio 2008\Projects\DbLinqLatest\src\DbMetal\Generator
\Implement
ation\Processor.cs:line 218
at DbMetal.Generator.Implementation.Processor.ProcessSchema
(Parameters parame
ters) in C:\Documents and Settings\Administrator\My Documents\Visual
Studio 2008
\Projects\DbLinqLatest\src\DbMetal\Generator\Implementation
\Processor.cs:line 11
2

Solution:
so i added one more option in src\DbLinq\Vendor\Implementation
\SchemaLoader.cs line 104
// bool
case "binary":

Hope this helps someone.

Thank you for making such an impressive tool.


Jonathan Pryor

unread,
Nov 8, 2009, 2:33:48 PM11/8/09
to dbl...@googlegroups.com
On Sat, 2009-11-07 at 23:34 -0800, mikcy wrote:
> I just started using DBMetal yesterday and i was trying to produce c#
> and dbml files for a MySql database that uses the binary datatype and
> i noticed that it isn't available, for some reason, as is shown below:

This should be fixed in r1268, though I made 'binary' a byte[], not a
bool (as you did). This seems more appropriate given:

http://msdn.microsoft.com/en-us/library/ms188362.aspx
http://dev.mysql.com/doc/refman/4.1/en/binary-varbinary.html

as BINARY can be used for variable data in both databases.

Thanks,
- Jon


Reply all
Reply to author
Forward
0 new messages