我的网络应用程序(.net v4)使用nHibernate将值保存回(sql08 R2)数据库。 UPDATE操作正在提交表单并将内容保存回db。 Stuff正常工作,直到其中一个包含字段的长度超过几百个字符。
VS正在抛弃ADO异常:
NHibernate.Exceptions.GenericADOException 用户代码未处理 消息=无法更新: [myProject.Business.Entity.Order#26718] [SQL: UPDATE命令SET orderDate = ?, shipmentTotal =?,total = ?, firstName = ?, lastName = ?,, customerInstitution = ?, phone = ?,, email =?,address =?,city = ?,, state =?,zip = ?, shippingFirstName =?,shippingLastName = ?, shippingAddress =?,shippingCity = ?, shippingState = ?, shippingZip = ?,, shippingPhone =?,paymentType = ?,, generalComments = ?, auditInfo = ?,, storeComments = ?, storeCommentsPriv = ?,taxExempt = ?, initiatedBy = ?, paidByCCNumber = ?, idUser = ?,, idAffiliate =?在哪里idOrder =?]
来源= myProject.DataAccess
SqlString = UPDATE命令SET orderDate = ?, shipmentTotal = ?, total = ?, firstName = ?, lastName = ?,, customerInstitution = ?, phone = ?,, email =?,address =?,city = ?,, state =?,zip = ?, shippingFirstName =?,shippingLastName = ?, shippingAddress =?,shippingCity = ?, shippingState = ?, shippingZip = ?,, shippingPhone =?,paymentType = ?,, generalComments = ?, auditInfo = ?,, storeComments = ?, storeCommentsPriv = ?,taxExempt = ?, initiatedBy = ?, paidByCCNumber = ?, idUser = ?,, idAffiliate =? WHERE idOrder =?
网页出现运行时错误:
String or binary data would be truncated.
显然,这不是最短的字段列表,但肯定不会推动容量限制。触发错误的字符串将转到最初设置为varchar(MAX)的varchar字段 - 我已将其拨回varchar(3000) - 但正如我所说 - 错误在长度超过300个字符之前被抛出
我没有在nHibernate方面的任何地方看到字段长度定义(在VS类中)但是不是一个nHibernate编码器我有点盲目地戳东西。消息'...将被截断。'确实听起来像数据库抱怨,但VS首先听到了ADO异常,所以我不知道接下来会在哪里进行故障排除。
THX