Changes saved via the Binding Navigator save the
changes to the dataset in memory. They do not persist
the changes down to the database level. You have to
write that code yourself. One way (the easiest) to do
that is to run an Update method on the Table Adapter,
which runs queries that are in the generated code.
To see the generated code, select <Show All Files>
in your Solution explorer, then look at the Designer.vb
file for your form. Visual Studio generates thousands
of lines of code for you to do data binding.
There are a multitude of ways, depending on your business
requirements, to update the database with changes in a
dataset. As is appropriate, Microsoft does not assume
one specific method, but leaves it up to you to choose
your own, uh, poison.
The events for Save and Delete and Add are not written
for you because you may not allow updating of the recordset.
Also, these can be handled differently in each application.
For example, I handle the <Save> option through an interface
on my business object, not through the TableAdapter.
Robin S.
[quoted text, click to view] "JJ" <NoEmailForMe...> wrote in message
news:eical254nkcrfma9ikp1d9c906i371st65@4ax.com...
>I am really baffled by this BindingNavigator thing, and hey I'm a
> newbie and trying to figure this stuff out.
>
> I drag a field from my dataset onto the form, and this
> bindingnavigator is created for me, ya know, with all the buttons to
> navigate, add, delete and such.
>
> So how come, if I delete a record, I need to press the Save button for
> the deleted record to really get deleted?
>
> So the code for BindingNavigatorDeleteItem_Click contains nothing, and
> this is the confusing part, where the heck is this code, and why can't
> I see it?
>
> So I add :
>
> Me.Validate()
> Me.DistributeBindingSource.EndEdit()
> Me.DistributeTableAdapter.Update(Me.ProcureDataSet.Distribute)
> like I see in the SaveItem method, and still, nothing happens.
>
> Everyone says I need to code by hand, but I believe that the
> development environment should do the bulk of the work for me. Am I
> supposed to know that most of the code for this navigator has been
> written for me, but some other stuff will have to be written manually?
>
> Please, help me understand... And Thanks for Understanding.