0

can somebody tell me the codes for updating the datagridview records..
here's what i wanna do.
for example there are 3 columns name , middle , last.
i want to update last but the problem is my datagridview doesnt update and still remain the same record but no errors..

4
Contributors
3
Replies
5
Views
9 Years
Discussion Span
Last Post by Ken Sharpe
0

you can try
1.) datagrid.Refresh()

or

2.) reset datasource bindingsource

0

can somebody tell me the codes for updating the datagridview records..
here's what i wanna do.
for example there are 3 columns name , middle , last.
i want to update last but the problem is my datagridview doesnt update and still remain the same record but no errors..

You See , if you dont Show us your Code, we will not know why your update does not work

0

csy is probably correct. Here's how it works:

You tell a datagrid to display certain data. That data is sitting somewhere else, like a database, then a copy of it is made to display in that datagrid.

After that, the datagrid is told (by the user) to change the data (last name in this case), which it does. The data in the database has now changed.

However, the datagrid has a COPY of the data, so just because you changed the database doesn't mean the datagrid knows about the change.

The way you tell the datagrid to get the fresh data is, right after the data changes, you call grid.Refresh, or give it a new datasource like csy said.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.