Subsonic 3:从“System.Byte"到“System.Byte[]"的无效转换 [英] Subsonic 3: Invalid cast from 'System.Byte' to 'System.Byte[]'
问题描述
我正在尝试使用 Subsonic 3.0,但每次尝试查询时都会出现此错误:
I'm trying to use Subsonic 3.0 but with every query I try it gives me this error:
从‘System.Byte’到‘System.Byte[]’的无效转换."
"Invalid cast from 'System.Byte' to 'System.Byte[]'."
我试过在几个不同的表上使用 linq 和 activerecord,但总是遇到这个问题.
I've tried using linq and activerecord on several different tables and always having this problem.
只是为了确保,这里有一段代码会引发错误:LiteralContent.Text = DB.Teksten.SingleOrDefault(t => t.ID == Convert.ToInt32(TextID)).Tekst;
Just to make sure, here is a code snipped that throws the error: LiteralContent.Text = DB.Teksten.SingleOrDefault(t => t.ID == Convert.ToInt32(TextID)).Tekst;
还尝试调试错误,但在单步执行时找不到错误的确切来源.
Also try to debug into the error but couldn't find the exact source of the error while stepping through it.
推荐答案
刚刚找到解决方案.一位用户已在 33 周前报告了此错误,并在以下位置发布了修复程序:http://blog.wekeroad.com/subsonic/subsonic-3-0-repository-template-update/
Just found the solution. A user already reported this bug 33 weeks ago and posted a fix at: http://blog.wekeroad.com/subsonic/subsonic-3-0-repository-template-update/
与 tinyint 数据类型的生成有关.
Has to do with generation of tinyint datatype.
这篇关于Subsonic 3:从“System.Byte"到“System.Byte[]"的无效转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!