I've gone through a few demos and walkthroughs trying to become familiar with
the new binding in vs2005. I'm having some success, but not every time.

I've create a dataset with the datasource configuration wizard. I have 3
tables in this dataset (expense, category, and type). I drag each table onto
a separate form. Visual studio creates a datagridview and binding navigator
on each form. When executed, the grids on each form populate correctly. The
problem is that one of the tables doesn't get updated when I press save, the
other two save correctly. I'm not writing any code, just using the
autogenerated code that VS writes:

Private Sub ExpenseBindingNavigatorSaveItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ExpenseBindingNavigatorSaveItem.Click
Me.Validate()
Me.ExpenseBindingSource.EndEdit()
Me.ExpenseTableAdapter.Update(Me.ExpenseDataSet.expense)
End Sub

I can't figure out what is different about the expense table/grid that is
causing it to not update. There are no errors generated. If I inspect the
dataset in the debugger after I make changes in the grid, the dataset appears
to get updated. I therefore believe it has something to do with the
BindingSource or TableAdapter. The changes never make it from the dataset to
the database (an access db).

Joel

Re: Trouble with BindingSource by Jim

Jim
Sat Feb 25 18:24:26 CST 2006

LIkely cause would be a lack of a primary key on the Expense table.

"Joel H" <JoelH@discussions.microsoft.com> wrote in message
news:C8F62B29-AA8C-4D27-A389-9597D9F11CD4@microsoft.com...
> I've gone through a few demos and walkthroughs trying to become familiar
> with
> the new binding in vs2005. I'm having some success, but not every time.
>
> I've create a dataset with the datasource configuration wizard. I have 3
> tables in this dataset (expense, category, and type). I drag each table
> onto
> a separate form. Visual studio creates a datagridview and binding
> navigator
> on each form. When executed, the grids on each form populate correctly.
> The
> problem is that one of the tables doesn't get updated when I press save,
> the
> other two save correctly. I'm not writing any code, just using the
> autogenerated code that VS writes:
>
> Private Sub ExpenseBindingNavigatorSaveItem_Click(ByVal sender As
> System.Object, ByVal e As System.EventArgs) Handles
> ExpenseBindingNavigatorSaveItem.Click
> Me.Validate()
> Me.ExpenseBindingSource.EndEdit()
> Me.ExpenseTableAdapter.Update(Me.ExpenseDataSet.expense)
> End Sub
>
> I can't figure out what is different about the expense table/grid that is
> causing it to not update. There are no errors generated. If I inspect
> the
> dataset in the debugger after I make changes in the grid, the dataset
> appears
> to get updated. I therefore believe it has something to do with the
> BindingSource or TableAdapter. The changes never make it from the dataset
> to
> the database (an access db).
>
> Joel
>
>