locked
Add Record BindingSource and BindingNavigator

    Question

  • 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()); <<--Error occur here
            }

    Inside Save Button Click:

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

     this.dsProducts.AcceptChanges();

     

    den2005

    Thursday, June 15, 2006 6:42 AM