日期:2014-05-20  浏览次数:20877 次

DBLinq中LINQ to MySql求助
使用Dblinq进行Linq to MySql开发,使用DBMetal生成代码文件,出现如下错误
DbMetal: Don't know how to convert the SQL type 'system' into a managed type.
参数名: dataType
后来跟踪调试Dblinq源代码发现问题原因是在提取一个存储过程时出错
该存储过程作为测试用,比较简单,内容如下
BEGIN
   SELECT 10;
END
参数为
IN oid varchar(200),OUT isExist int
进一步跟踪发现,问题根源在于MySqlSchemaLoader.LoadStoredProcedures函数中分析存储过程时将存储过程的返回值类型解析为System.Byte[]类型,而在UnpackRawDbType时将其解析为System,最后引发出异常。

问题描述和我的分析如上,不知道大家有没有遇到类似的问题,以及是如何解决的,或者有好的思路也欢迎一起讨论。

------解决方案--------------------
1. Create a table with "int PRIMARY KEY". 
2. Run DbMetal to generate the code file.
3. Rename the DB file.
4. Create a new DB and tables with "INTEGER PRIMARY KEY AUTOINCREMENT".

after that i tried insert, query, update to DB are OK.


Please, try out the solution on the link below:

http://code.google.com/p/dblinq2007/issues/detail?id=132#c2
------解决方案--------------------
是存储过程的问题,把数据库存储过程都删掉就行了,尽管我不知道具体为什么