明细表插入记录Insert报错:行插入位置-2147483648无效。

作者:C/S框架网  发布日期:2018/11/12 23:24:38
  明细表插入记录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



参考文档:

EFCore报错:OracleException: ORA|01465: 无效的十六进制数字|C/S开发框架
MySql MySqlBulkLoader批量导入数据(批导BulkInsert)|C/S开发框架
达梦数据库DmException: 变量空间溢出 [sql]: INSERT INTO,Microsoft.EntityFrameworkCore.DbUpdateException|C/S开发框架
CSFramework开发框架报错:违反并发性:UpdateCommand影响了预期1条记录中的0条
VS解决Files的值"<<<<<<< HEAD"无效。路径中具有非法字符。
DevExpress DateEdit组件是空日期,传入SQL参数报错解决方法
.NETCore WebApi运行报错:System.AggregateException:“Some services are not able to be constructed|C/S开发框架
.NETCore使用EF保存图片报错:OracleExceptiol: ORA|01460:转换请求无法实施或不合理|C/S开发框架
踩坑日记 | DevExpress GridView.GetSelectedRows方法返回无效的RowHandle行号|C/S开发框架
踩坑日记 | DevExpress GridControl设置DataSource数据源无效|C/S开发框架
EF报错:从 datetime2 数据类型到 datetime 数据类型的转换产生一个超出范围的值|C/S开发框架
GIT报错:Could not get HEAD hash. libgit2 returned:repository path "xx" is not owned by current user
SqlBulkCopy.WriteToServer报错:“Unable to cast object of type 'System.Guid' to type 'System.String'.”
CSFramework.EF数据库框架测试MySqlBulkLoader批量插入功能报错(解决方案)
FastReport.NET报错 System.PlatformNotSupportedException:“Operation is not supported on this platform.”
XtraReport 报错:Report scripts were found in the application while the script execution is disabled.