明细表插入记录Insert报错:行插入位置-2147483648无效。
明细表插入记录Insert报错:行插入位置-2147483648无效。
解决方案: 参考下面代码,若FocusedRowHandle的值<0,则从0行开始插入记录。
C# Code:
int index = gvDetailSemi.FocusedRowHandle < 0 ? 0 : gvDetailSemi.FocusedRowHandle;
_BLL.CurrentBusiness.Tables[dt_ProductSemi.__TableName].Rows.InsertAt(row, index);
gvDetailSemi.FocusedRowHandle = gvDetailSemi.FocusedRowHandle - 1;
//来源:C/S框架网(www.csframework.com) QQ:23404761
int index = gvDetailSemi.FocusedRowHandle < 0 ? 0 : gvDetailSemi.FocusedRowHandle;
_BLL.CurrentBusiness.Tables[dt_ProductSemi.__TableName].Rows.InsertAt(row, index);
gvDetailSemi.FocusedRowHandle = gvDetailSemi.FocusedRowHandle - 1;
//来源:C/S框架网(www.csframework.com) QQ:23404761
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网