473,386 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Binding Navigator Make an Exception (Advanced)

I'm working with database and vs2010
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
  1. "Column 'Name' does not allow nulls"
  2.  
  3. System.Data.NoNullAllowedException: Column 'Name' does not allow nulls.
  4.    at System.Data.DataColumn.CheckNullable(DataRow row)
  5.    at System.Data.DataTable.RaiseRowChanging(DataRowChangeEventArgs args, DataRow eRow, DataRowAction eAction, Boolean fireEvent)
  6.    at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32 proposedRecord, DataRowAction action, Boolean isInMerge, Boolean suppressEnsurePropertyChanged, Int32 position, Boolean fireEvent, Exception& deferredException)
  7.    at System.Data.DataTable.InsertRow(DataRow row, Int64 proposedID, Int32 pos, Boolean fireEvent)
  8.    at System.Data.DataView.FinishAddNew(Boolean success)
  9.    at System.Data.DataRowView.EndEdit()
  10.    at System.Windows.Forms.CurrencyManager.EndCurrentEdit()
  11.    at System.Windows.Forms.CurrencyManager.ChangeRecordState(Int32 newPosition, Boolean validating, Boolean endCurrentEdit, Boolean firePositionChange, Boolean pullData)
  12.    at System.Windows.Forms.CurrencyManager.set_Position(Int32 value)
  13.    at System.Windows.Forms.BindingSource.set_Position(Int32 value)
  14.    at System.Windows.Forms.BindingSource.MovePrevious()
  15.    at System.Windows.Forms.BindingNavigator.OnMovePrevious(Object sender, EventArgs e)
  16.    at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
  17.    at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
  18.  
Oct 7 '10 #1
0 1228

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Mike | last post by:
I wasn't real sure which was the best group for this post - please feel free to redirect to the appropriate group(s). My form uses a binding navigator to move through my data source (imagine...
1
by: ankz | last post by:
Hi Guys I have got 3 tables - in Access Database with Student ID as primary Key in all and all tables are linked with 1 to 1 relationship. I have code the everying with manual program to...
1
by: =?Utf-8?B?Sm9iIExvdA==?= | last post by:
how can i add a check box to binding navigator control? thanks
0
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
I am dragging a data souce (access.mdb) to a form. C# automaticallt creates the table adapter, binding adapter, etc. But for some reason, it is not automatically creating the binding navigator. Any...
3
by: Rick | last post by:
VS 2005 The short version: How can I set the enabled state of a button depending on if a strongly-typed datatable has a DeleteCommand? *************************** The long version:
2
by: Randy | last post by:
Hi, I'd like to add a new blank record to a form for the user to input data. What I am trying to do is exactly what the + on the binding navigator does, with some additional steps involved. So,...
2
by: Randy | last post by:
Hi, I'm trying to figure out some binding navigator code. If I have the primary field value as selected by the user in a combo box, how can I instruct the binding navigator to move to that...
0
by: ashishchatterjee | last post by:
how can we move the data in the field using binding navigator tool so please send methe code for the following. OS: windows xp sp2 Languge:visual studio2005
1
by: qazplm114477 | last post by:
hello, I have notice that when i drag a table/column from my dataset onto my form, VS2008 automatically populates the form with a binding navigator and some other stuff like the tableadapters and...
1
by: dorkboy | last post by:
Hi all, I am a newbie using VB.net in VS 2008. I took over a vb.net winform application that has a binding navigator in it. The users wanted to add 2 new fields to the form. I added the new...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.