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
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.
up!
thx
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.
I am getting this error but can't find the file schemaloader.typemapping.cs
in the downloaded project anywhere. Any other ideas?
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
Please, try out the solution on the link below:
http://code.google.com/p/dblinq2007/issues/detail?id=132#c2
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
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". :-(