d.REMARK = this.txtRemark.Text;
当 txtRemark 文本为空时保存出错.
配置文件为
<property name="REMARK" type="String">
<column name="REMARK" length="200" sql-type="VARCHAR2" not-null="false"/>
</property>
解决方法
把配置文件改为
<property name="REMARK" type="Nullables.NHibernate.EmptyAnsiStringType, Nullables.NHibernate">
<column name="REMARK" length="200" sql-type="Nullables.NHibernate.EmptyAnsiStringType, Nullables.NHibernate" not-null="false"/>
</property>
当然要引入Nullables和Nullables.NHibernate这两个程序集.