winform 异常

来源:互联网 发布:mysql 控制台输出 编辑:程序博客网 时间:2024/06/05 06:15
DataGridView 中发生以下异常:  
System.ArgumentException: 不能将列“CQUESTION_ID”设置为空。请改用 DBNull。  
在 System.Data.DataRow.set_Item(DataColumn column, Object value)  
在 System.Data.DataRowView.SetColumnValue(DataColumn column, Object value)  
在 System.Data.DataColumnPropertyDescriptor.SetValue(Object component, Object value)  

在 System.Windows.Forms.DataGridView.DataGridViewDataConnection.PushValue(Int32 boundColumnIndex, Int32 columnIndex, Int32 rowIndex, Object value)  


要替换此默认对话框,请处理 DataError 事件。  

 private void dgData_DataError(object sender, DataGridViewDataErrorEventArgs e)
        {


        }

0 0
原创粉丝点击