Issue 238 in dblinq2007: DbMetal: Don't know how to convert the SQL type 'system' into a managed type. Parameter name: dataType

68 views
Skip to first unread message

dblin...@googlecode.com

unread,
Apr 14, 2010, 9:37:21 AM4/14/10
to dblin...@googlegroups.com
Status: New
Owner: ----

New issue 238 by singhalnitin7: DbMetal: Don't know how to convert the SQL
type 'system' into a managed type. Parameter name: dataType
http://code.google.com/p/dblinq2007/issues/detail?id=238


What steps will reproduce the problem?
1.Using MySql Database having stored procedure returning recordset
2.after debuging LoadStoredProcedures function gives error due to retrun
type of Stored Procedure is System.Byte[]


What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?
0.20

Please provide any additional information below.


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

dblin...@googlecode.com

unread,
Apr 14, 2010, 11:22:26 AM4/14/10
to dblin...@googlegroups.com
Updates:
Labels: Type-Defect Component-MySQL Component-DbMetal Priority-Medium

Comment #1 on issue 238 by jonmpryor: DbMetal: Don't know how to convert

the SQL type 'system' into a managed type. Parameter name: dataType
http://code.google.com/p/dblinq2007/issues/detail?id=238

We should look into migrating the MySql support to using DbSchemaLoader so
that we can
let MySql.Data.dll perform type conversions instead of using
SchemaLoader.TypeMapping.cs.

dblin...@googlecode.com

unread,
Apr 23, 2010, 11:34:26 AM4/23/10
to dblin...@googlegroups.com

Comment #2 on issue 238 by singhalnitin7: DbMetal: Don't know how to
convert the SQL type 'system' into a managed type. Parameter name: dataType
http://code.google.com/p/dblinq2007/issues/detail?id=238

Whenever we work with dblinq version 0.19 and 0.20.1, it give an error
first of all not to work with stored procedure error to 'dont know how
to convert sqltype system to manged code' whereas perivious version
0.17 generate the stored procedure . other problem is MySql datatype
time is defined by c# System.Timespan but dbmetal convert it to
datetime in cs file when fetching data it gives an error. Please help
me out or if this is a bug then can i expect the fix in next release?


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--
dblinq-bugs maillist - dblin...@googlegroups.com
http://groups.google.com/group/dblinq-bugs

dblin...@googlecode.com

unread,
Jul 7, 2010, 11:01:59 AM7/7/10
to dblin...@googlegroups.com

Comment #3 on issue 238 by cldelaroque: DbMetal: Don't know how to convert
the SQL type 'system' into a managed type. Parameter name: dataType
http://code.google.com/p/dblinq2007/issues/detail?id=238

up!

thx

dblin...@googlecode.com

unread,
Aug 13, 2010, 2:33:25 PM8/13/10
to dblin...@googlegroups.com

Comment #4 on issue 238 by keith.lawrence: DbMetal: Don't know how to
convert the SQL type 'system' into a managed type. Parameter name: dataType
http://code.google.com/p/dblinq2007/issues/detail?id=238

I took a look at the source and have a *horrible* hack to get it working
(needed a fix in a hurry).. I'll attempt to outline the problem so someone
else with better regex knowledge can fix it properly!

>> HACK >>
1- Download the source, and change line 48 of IDataTypeExtensions.cs to
read; if (match.Success && rawType != "System.Byte[]")
2- On line 217 of SchemaLoader.TypeMapping.cs, add in another case
statement; case "system.byte[]":
Rebuild and it should run ok (does for me, anyway)

>> ISSUE >>
The regex used in UnpackRawDbType catches the System.Byte[] raw data type
and matches the sqltype as "system", which doesn't correspond to any known
data type.

Hope that helps someone.

dblin...@googlecode.com

unread,
Aug 17, 2010, 12:21:26 AM8/17/10
to dblin...@googlegroups.com

Comment #5 on issue 238 by libertyprevails: DbMetal: Don't know how to
convert the SQL type 'system' into a managed type. Parameter name: dataType
http://code.google.com/p/dblinq2007/issues/detail?id=238

I am getting this error but can't find the file schemaloader.typemapping.cs
in the downloaded project anywhere. Any other ideas?

dblin...@googlecode.com

unread,
Nov 14, 2010, 12:10:44 AM11/14/10
to dblin...@googlegroups.com

Comment #6 on issue 238 by ipsoftdev: DbMetal: Don't know how to convert
the SQL type 'system' into a managed type. Parameter name: dataType
http://code.google.com/p/dblinq2007/issues/detail?id=238

Hi everyone,

DbLinq version: 0.20.1
OS: Win7 x64
MySQL: 5.5
.NET connector: 6.2.2.0

According to my investigation this bug has to do with determining proper
return type for a MySQL function. There's a total of 3 code modifications
to resolve the problem. It would be great if someone with better knowledge
of dblinq could validate the fixes and incorporate them into the
next release.

Code change #1 - fixing the code generation problem

1) Open file: src\DbLinq.MySql\MySqlSchemaLoader.StoredProcedures.cs
2) Find method ReadProcedure
3) Find line below and change the call to use GetString instead of
GetAsString like below:

procedure.returns = rdr.GetString(field++);
//procedure.returns = rdr.GetAsString(field++);

Code change #2 - remove ` character that was preventing at least in my case
proper compilation of generated code

One of ways to resolve this issue is to modify the file below. There might
be a better place for this change...

1) Open file \src\DbLinq.MySql\MySqlSchemaLoader.cs
2) Find function ParseProcParams
3) Replace line:
string paramString = inputData.param_list;
with
string paramString = inputData.param_list.Replace("`", string.Empty);

Code change #3 - The IExecuteResult was failing the compilation.

There are two ways to fix one. I went with a)
a) Use fully qualified path (with namespace) for IExecuteResult
b) Include namespace

1) Open file \src\DbMetal\Generator\CodeDomGenerator.cs
2) Go to line 537 and replace

new CodeTypeReference("IExecuteResult"),
with
new CodeTypeReference("System.Data.Linq.IExecuteResult"),


Phew... it works now =D


dblin...@googlecode.com

unread,
Mar 31, 2012, 9:56:18 PM3/31/12
to dblin...@googlegroups.com

Comment #7 on issue 238 by tos.oliv...@gmail.com: DbMetal: Don't know how
to convert the SQL type 'system' into a managed type. Parameter name:
dataType
http://code.google.com/p/dblinq2007/issues/detail?id=238

Please, try out the solution on the link below:
http://code.google.com/p/dblinq2007/issues/detail?id=132#c2

dblin...@googlecode.com

unread,
Apr 6, 2012, 12:26:23 AM4/6/12
to dblin...@googlegroups.com

Comment #8 on issue 238 by worldofy...@gmail.com: DbMetal: Don't know how
to convert the SQL type 'system' into a managed type. Parameter name:
dataType
http://code.google.com/p/dblinq2007/issues/detail?id=238

Hi,
Has this issue been resolved. I am still getting the same error
of "DbMetal: Don't know how to convert the SQL type 'system' into a managed
type. Parameter name: dataType" when i run the file "run_myMetal.bat".

@ipsoft...@gmail.com : I am new to the C# world. First thing that i need is
Linq to MySql to work. Is it in a stable stage now? When i do the changes
mentioned by you, should i build the DbMetal.exe again from the src or is
it referred internally.
Little more elaboration on the steps you have mentioned will help a lot.

Thanks,
Yogi

dblin...@googlecode.com

unread,
Apr 6, 2012, 12:30:24 AM4/6/12
to dblin...@googlegroups.com

Comment #9 on issue 238 by worldofy...@gmail.com: DbMetal: Don't know how
to convert the SQL type 'system' into a managed type. Parameter name:
dataType
http://code.google.com/p/dblinq2007/issues/detail?id=238

Hi,
Has this issue been resolved? I am still getting the same error

of "DbMetal: Don't know how to convert the SQL type 'system' into a managed

type. Parameter name: dataType" when i run the file "run_myMetal.bat". :-(

Reply all
Reply to author
Forward
0 new messages