Hi. I have a form with a listbox and a few label fields all bound to a
dataset. When i navigate the listbox the labels change accordingly. so far
everything works good.
I made a button to delete a record. I delete the row from the datatable and
update the database with the adapter and that all works good. The record is
removed from the listbox.
Here is my problem.
I made another form to add a new record (has its own questions, input
fields, etc.). This form has its own connection, adapter and dataset
variables on it that it uses to add the new record. It works fine (adds the
new record to the actual database) but when I close that form and am now
back at the previous form (with the listbox), I cannot get the listbox to
update.
I've tried several suggestions from the web.
-re-filling the dataset (i.e. ds.clear() and then adapter.fill(ds,"table").
that did not work.
-Using the currencymanager's refresh() method from the dataset's
bindingcontext. That did not work.
-I've tried re-binding. as well as suspendbinding() and resumebinding().
I just don't understand it.
If I close that main form (the one with the listbox) and then go back into
it, it will now show the newly added record!! The form's startup has
nothing special that I didn't already try for refreshing it.
Any suggestions?
Thank you very much.
-Spock