Adding Record Using BindingSource and BindingNavigator

G

Guest

Hi everybody,

I create a form with textboxes for display and data entry. I used
bindingnavigator and bindingsource to make
that happen, but having problems with adding new record...I finally
successfully added new record in dsProducts
and in the bindingnavigator shows correct number of records..But when I
clicked any navigation controls. It
displays an error message of:
Column 'ProductId' does not allow nulls.

and data is not save in the database also even I used the
dataadapter.Update(dataset)...

Is there anyone who knows to solve this?? Thanks.


Main Program:

[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new BindedControlsForm());
}

Inside Save Button Click:

this.Validate();
this.BindingContext[dsProducts.Products.DefaultView].EndCurrentEdit();

this.dsProducts.AcceptChanges();


den2005
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top