求救,datagridview显红叉

csdn_风中雪狼 2014-03-18 08:45:11
DataGridView控件在使用时现红叉,只有一台机器会出现这种情况,各位大神分析下原因

...全文
566 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
csdn_风中雪狼 2014-03-19
  • 打赏
  • 举报
回复
只有一台机器上会有这个问题, 各位大神分析下原因
csdn_风中雪狼 2014-03-19
  • 打赏
  • 举报
回复
引用 4 楼 xunzaosiyecao 的回复:
把绑定数据附近的代码贴出来吧
数据绑定是通过 Rows.Add的方式进添加的,每一个单元格都有值的,
csdn_风中雪狼 2014-03-18
  • 打赏
  • 举报
回复
没有多线程之类的, 就是单纯的一个数据录入, 就会出现这种情况 各位帮忙分析下
csdn_风中雪狼 2014-03-18
  • 打赏
  • 举报
回复
有关调用实时(JIT)调试而不是此对话框的详细信息, 请参见此消息的结尾。 ************** 异常文本 ************** System.AccessViolationException: 尝试读取或写入受保护的内存。这通常指示其他内存已损坏。 在 System.Drawing.SafeNativeMethods.Gdip.GdipDrawLineI(HandleRef graphics, HandleRef pen, Int32 x1, Int32 y1, Int32 x2, Int32 y2) 在 System.Drawing.Graphics.DrawLine(Pen pen, Int32 x1, Int32 y1, Int32 x2, Int32 y2) 在 System.Windows.Forms.DataGridViewCell.PaintBorder(Graphics graphics, Rectangle clipBounds, Rectangle bounds, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle) 在 System.Windows.Forms.DataGridViewTopLeftHeaderCell.PaintBorder(Graphics graphics, Rectangle clipBounds, Rectangle bounds, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle) 在 System.Windows.Forms.DataGridViewTopLeftHeaderCell.PaintPrivate(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, Int32 rowIndex, DataGridViewElementStates cellState, Object formattedValue, String errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts, Boolean computeContentBounds, Boolean computeErrorIconBounds, Boolean paint) 在 System.Windows.Forms.DataGridViewTopLeftHeaderCell.Paint(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, Int32 rowIndex, DataGridViewElementStates cellState, Object value, Object formattedValue, String errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts) 在 System.Windows.Forms.DataGridViewCell.PaintWork(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, Int32 rowIndex, DataGridViewElementStates cellState, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts) 在 System.Windows.Forms.DataGridView.PaintTopLeftHeaderCell(Graphics g) 在 System.Windows.Forms.DataGridView.PaintGrid(Graphics g, Rectangle gridBounds, Rectangle clipRect, Boolean singleVerticalBorderAdded, Boolean singleHorizontalBorderAdded) 在 System.Windows.Forms.DataGridView.OnPaint(PaintEventArgs e) 在 System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs) 在 System.Windows.Forms.Control.WmPaint(Message& m) 在 System.Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.DataGridView.WndProc(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** 已加载的程序集 ************** mscorlib 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000) 基本代码: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ---------------------------------------- jldhr 程序集版本: 1.0.0.0 Win32 版本: 1.0.0.0 基本代码: file:///D:/Program%20Files/HR/人事管理系统/jldhr.exe ---------------------------------------- System.Xml 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000) 基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- System 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000) 基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Windows.Forms 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000) 基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System.Drawing 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000) 基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- mscorlib.resources 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000) 基本代码: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ---------------------------------------- System.Configuration 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000) 基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll ---------------------------------------- myLineTextBox 程序集版本: 1.0.0.0 Win32 版本: 1.0.0.0 基本代码: file:///D:/Program%20Files/HR/人事管理系统/myLineTextBox.DLL ---------------------------------------- MyComoboBox 程序集版本: 1.0.0.0 Win32 版本: 1.0.0.0 基本代码: file:///D:/Program%20Files/HR/人事管理系统/MyComoboBox.DLL ---------------------------------------- System.Core 程序集版本: 3.5.0.0 Win32 版本: 3.5.21022.8 built by: RTM 基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll ---------------------------------------- System.Data 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000) 基本代码: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll ---------------------------------------- System.Transactions 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000) 基本代码: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll ---------------------------------------- System.EnterpriseServices 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000) 基本代码: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll ---------------------------------------- System.Windows.Forms.resources 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400) 基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_zh-CHS_b77a5c561934e089/System.Windows.Forms.resources.dll ---------------------------------------- System.Data.DataSetExtensions 程序集版本: 3.5.0.0 Win32 版本: 3.5.21022.8 built by: RTM 基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Data.DataSetExtensions/3.5.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll ---------------------------------------- System.Data.OracleClient 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.3053 (netfxsp.050727-3000) 基本代码: file:///C:/WINDOWS/assembly/GAC_32/System.Data.OracleClient/2.0.0.0__b77a5c561934e089/System.Data.OracleClient.dll ---------------------------------------- System.Data.OracleClient.resources 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400) 基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Data.OracleClient.resources/2.0.0.0_zh-CHS_b77a5c561934e089/System.Data.OracleClient.resources.dll ---------------------------------------- ************** JIT 调试 ************** 要启用实时(JIT)调试, 该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置 jitDebugging 值。 编译应用程序时还必须启用 调试。 例如: <configuration> <system.windows.forms jitDebugging="true" /> </configuration> 启用 JIT 调试后,任何无法处理的异常 都将被发送到在此计算机上注册的 JIT 调试器, 而不是由此对话框处理。 错误信息二
csdn_风中雪狼 2014-03-18
  • 打赏
  • 举报
回复
有关调用实时(JIT)调试而不是此对话框的详细信息, 请参见此消息的结尾。 ************** 异常文本 ************** System.InvalidOperationException: 对象当前正在其他地方使用。 在 System.Drawing.Graphics.CheckErrorStatus(Int32 status) 在 System.Drawing.Graphics.DrawRectangle(Pen pen, Int32 x, Int32 y, Int32 width, Int32 height) 在 System.Drawing.Graphics.DrawRectangle(Pen pen, Rectangle rect) 在 System.Windows.Forms.ControlPaint.PaintTableCellBorder(TableLayoutPanelCellBorderStyle borderStyle, Graphics g, Rectangle bound) 在 System.Windows.Forms.TableLayoutPanel.OnPaintBackground(PaintEventArgs e) 在 System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs) 在 System.Windows.Forms.Control.WmEraseBkgnd(Message& m) 在 System.Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.ScrollableControl.WndProc(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** 已加载的程序集 ************** mscorlib 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400) 基本代码: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ---------------------------------------- jldhr 程序集版本: 1.0.0.0 Win32 版本: 1.0.0.0 基本代码: file:///D:/Program%20Files/HR/人事管理系统/jldhr.exe ---------------------------------------- System.Xml 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400) 基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- System 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400) 基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Windows.Forms 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400) 基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System.Drawing 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400) 基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- mscorlib.resources 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400) 基本代码: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ---------------------------------------- System.Configuration 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400) 基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll ---------------------------------------- Microsoft.JScript 程序集版本: 8.0.0.0 Win32 版本: 8.0.50727.1433 基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.JScript/8.0.0.0__b03f5f7f11d50a3a/Microsoft.JScript.dll ---------------------------------------- myLineTextBox 程序集版本: 1.0.0.0 Win32 版本: 1.0.0.0 基本代码: file:///D:/Program%20Files/HR/人事管理系统/myLineTextBox.DLL ---------------------------------------- MyComoboBox 程序集版本: 1.0.0.0 Win32 版本: 1.0.0.0 基本代码: file:///D:/Program%20Files/HR/人事管理系统/MyComoboBox.DLL ---------------------------------------- System.Data 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400) 基本代码: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll ---------------------------------------- System.Transactions 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400) 基本代码: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll ---------------------------------------- System.EnterpriseServices 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400) 基本代码: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll ---------------------------------------- ExportHelper 程序集版本: 1.0.0.0 Win32 版本: 1.0.0.0 基本代码: file:///D:/Program%20Files/HR/人事管理系统/ExportHelper.DLL ---------------------------------------- System.Core 程序集版本: 3.5.0.0 Win32 版本: 3.5.21022.8 built by: RTM 基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll ---------------------------------------- System.Windows.Forms.resources 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400) 基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_zh-CHS_b77a5c561934e089/System.Windows.Forms.resources.dll ---------------------------------------- System.Data.DataSetExtensions 程序集版本: 3.5.0.0 Win32 版本: 3.5.21022.8 built by: RTM 基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Data.DataSetExtensions/3.5.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll ---------------------------------------- System.Data.OracleClient 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400) 基本代码: file:///C:/WINDOWS/assembly/GAC_32/System.Data.OracleClient/2.0.0.0__b77a5c561934e089/System.Data.OracleClient.dll ---------------------------------------- System.Data.OracleClient.resources 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400) 基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Data.OracleClient.resources/2.0.0.0_zh-CHS_b77a5c561934e089/System.Data.OracleClient.resources.dll ---------------------------------------- Microsoft.Office.Interop.Excel 程序集版本: 12.0.0.0 Win32 版本: 12.0.4518.1014 基本代码: file:///D:/Program%20Files/HR/人事管理系统/Microsoft.Office.Interop.Excel.DLL ---------------------------------------- System.Drawing.resources 程序集版本: 2.0.0.0 Win32 版本: 2.0.50727.1433 (REDBITS.050727-1400) 基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing.resources/2.0.0.0_zh-CHS_b03f5f7f11d50a3a/System.Drawing.resources.dll ---------------------------------------- ************** JIT 调试 ************** 要启用实时(JIT)调试, 该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置 jitDebugging 值。 编译应用程序时还必须启用 调试。 例如: <configuration> <system.windows.forms jitDebugging="true" /> </configuration> 启用 JIT 调试后,任何无法处理的异常 都将被发送到在此计算机上注册的 JIT 调试器, 而不是由此对话框处理。 错误信息一

111,093

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧