Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Normal DataBinding - NotNull Columns - How to trap Error and Display custom Error Msg.

$
0
0

I have a simple winform with databining on CustomerContacts Table.  This table has emailId column which is "Unique and Not Null"

I also have BindingNavigator.  When i click on "+" button of BindingNavigator, a new record is created. I enter few details except Emailid. and I click on "+" button of BindingNavigator again.   At this stage an unhandled exception occurs because system tries to save record in DataSet and EmailId column shots for null error.   

Can i have some event at this stage where if i click on "+" button of BindingNavigator or any other button resulting system to save record in underlying dataset , I get a chance to display custom error message.  I tried BindingSource.DataError, but it looks like the event does not fire.

Imp: This Winform is open from Outlook Addin. Meaning on click on Menu in Outlook, this Winform is opened.

Regards

 

 

 


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>