0
votes

I've created a datagridview from the tools and chosed the datasource from db. By using dataset of a table I am displaying data in the datagridview. But When I add new data to the database my gridview still looks the same its not refreshing with the new data :( kindly assist. Thanks in advance

3
Provide the code that you are trying to do all this stuff and where are you having problem. - Niranjan Singh

3 Answers

0
votes

When you add data to the database, you need to re-read data from the database to the DataSet that is bound to the DataGridView control to see the changes. Why don't you add data to the DataSet, it will update the DataGridView and after you finish, you can update the database using DataSet. It is meant to be that way.

0
votes

Refresh your DataGridView.DataSource when new data is inserted into database.

0
votes

After the record is added call:

yourDataGridView.DataSource = someTableData   
yourDataGridView.DataBind();

That should reload the data.