I have insert table from data set to windows form as details, and vs insert binding navigator.
but
on runtime if the user click add then click move, dot net show exception that data is not valid, I tried to handle this exception but I didn't find any event handler on design time!!
how to handle this exception or cancel the new row or show message tell the user that he have to enters data.
here the exception:
Expand|Select|Wrap|Line Numbers
- "Column 'Name' does not allow nulls"
- System.Data.NoNullAllowedException: Column 'Name' does not allow nulls.
- at System.Data.DataColumn.CheckNullable(DataRow row)
- at System.Data.DataTable.RaiseRowChanging(DataRowChangeEventArgs args, DataRow eRow, DataRowAction eAction, Boolean fireEvent)
- at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32 proposedRecord, DataRowAction action, Boolean isInMerge, Boolean suppressEnsurePropertyChanged, Int32 position, Boolean fireEvent, Exception& deferredException)
- at System.Data.DataTable.InsertRow(DataRow row, Int64 proposedID, Int32 pos, Boolean fireEvent)
- at System.Data.DataView.FinishAddNew(Boolean success)
- at System.Data.DataRowView.EndEdit()
- at System.Windows.Forms.CurrencyManager.EndCurrentEdit()
- at System.Windows.Forms.CurrencyManager.ChangeRecordState(Int32 newPosition, Boolean validating, Boolean endCurrentEdit, Boolean firePositionChange, Boolean pullData)
- at System.Windows.Forms.CurrencyManager.set_Position(Int32 value)
- at System.Windows.Forms.BindingSource.set_Position(Int32 value)
- at System.Windows.Forms.BindingSource.MovePrevious()
- at System.Windows.Forms.BindingNavigator.OnMovePrevious(Object sender, EventArgs e)
- at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
- at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)