BindingSource is not updated!

V

vsta2005

Hi all,

I'm quite new to vb 2005 and need some help:

I have 2 forms say formA and formB, formA has a dataset1,
table1adapter & table1bindingsource (backend database is access). It
also has a datagrid1 and a bunch of other controls and they're all
bound to the table1bindingsource. There is no binding navigation on
this formA, the user is allow to navigate using the datagrid1, edit
the data using the controls. If the want to add new record, they have
to click on button1

The button1 on formA, when clicked, formB will show, which also has
dataset1, table1adapter and table1bindingsource and a numbers of
unbound controls which basically allow the user to enter data for the
new record. Once they click on the OK button on formB, I do some
backend checking for the data, if all is well, then I generate the key
for the new record then add the new record into the dataset1 and then
update the database and formB is then closed

The new record is added to the backend database, however, the
table1bindingsource on formA is not refreshed and thus not displayed
on formA after formB is closed.

Any help would be greatly appreciated.
 
R

Rick

You have to understand that your binding sources are not connected to
anything, so they don't know what happens at the database level.

To get these new rows you will have to trigger a tableadapter.Fill.
Presumably you know when a user adds a row in FormB, so just trigger a Fill
at that point.

The concept is completely different that what I am used to as well. I'm not
entirely convinced that this disconneced state is any advantage since all my
clients have < 50 concurrent users with relatively light DB usage. In any
case, it is the way it is!

Another concept that makes no business sense to me is reading an entire
table and filtering the results at the client. For example, when you have an
Orders/OrderDetail relationship. If you have millions of OrderDetail
records it is not practical to load them all into the client and then
filter. So you end up writing more code to only request the rows you need
from the DB which makes the automatic coding that VS can do useless. Again,
it is the way it is!

Rick
 

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