Hello, I'm trying to refresh the datagrid after using the SQL UPDATE statement. The data changes physically in the database but the datagrid is not affected. The data is changed only after i restart the program.
How can i get the datagrid to refresh or update?
I have tried using, among other code, the refresh() method, but it does not work.
The way i understand from reading some sites is that the data from the datagrid is suppose to be cleared and then it can be refreshed.
This is the code i placed inside a button:
daDataAdapter.Update(DsDataSet.Tables("tblMyTable"))
DsDataSet.AcceptChanges()
DsDataSet.Tables("tblMyTable").Clear()
daDataAdapter.Fill(DsDataSet, "tblMyTable") 'IGNORES THIS LINE I GUESS
dgDataGrid.Refresh()
This code only clears the datagrid. Why does it not run the fill() method?
How can i get the datagrid to refresh or update?
I have tried using, among other code, the refresh() method, but it does not work.
The way i understand from reading some sites is that the data from the datagrid is suppose to be cleared and then it can be refreshed.
This is the code i placed inside a button:
daDataAdapter.Update(DsDataSet.Tables("tblMyTable"))
DsDataSet.AcceptChanges()
DsDataSet.Tables("tblMyTable").Clear()
daDataAdapter.Fill(DsDataSet, "tblMyTable") 'IGNORES THIS LINE I GUESS
dgDataGrid.Refresh()
This code only clears the datagrid. Why does it not run the fill() method?