首页 新闻 赞助 找找看

NHibernate指定的转换无效

0
悬赏园豆:10 [已关闭问题] 关闭于 2011-05-11 17:42

在NHibernate3.0中我的映射文件是

 <property name="IsForce" type="String">
   <column name="IsForce" length="1" sql-type="char" not-null="false"/>

自定义类文件:

 protected string _isForce;

public string IsForce
  {
   get { return _isForce; }
   set
   {
    if ( value != null && value.Length > 1)
     throw new ArgumentOutOfRangeException("Invalid value for IsForce", value, value.ToString   ());
    _isForce = value;
   }
  }

运行报指定的转换无效。

问题补充: 数据库是SQL Server2008
XiYO的主页 XiYO | 初学一级 | 园豆:18
提问于:2011-05-06 14:17
< >
分享
所有回答(1)
0

string ,和char 转换是不行的。IsForce 定义为char

刚子85 | 园豆:205 (菜鸟二级) | 2011-05-06 15:21
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册