press button twice to Refresh Dataset and show change in datagrid

H

headbig003

Hello
I am using dataset to populate datagrid.

I use button outside of datagrid to insert new row and update datagrid.


After updated or inserted new information to datagrid, user has to
press Save button(outside of datagrid) to save the change to
database(use sql statement to dave to db directly) then update
dataset(datadapter.fill(ds) and datagrid.datasource = ds).

The problem is that I have to press Save button twice to see the actual
change in datagrid. I know database is updated right after I press
Save button for first time, but somehow dataset is not updated at once.

Can anybody tell me why this thing happening to me please?

By the way c# is the language I am using.

Thank you in advance.
 

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