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..

Recommended Answers

All 3 Replies

you can try
1.) datagrid.Refresh()

or

2.) reset datasource bindingsource

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.