S
Sanddevil
Hi there - I hope someone out there can help me! I'm using a .Net DataGrid
Class to show the results of a SQL query in a spreadsheet type control. The
code, which works fine is:
iRowCount = oleDbDataAdapter1->Fill(dataSet1);
dataGrid1->DataSource = dataSet1->Tables->Item[0]->DefaultView;
I then update the underlying data in the database elsewhere in the code by
adding
some new rows and
want the datagrid control to show the updated and new rows correctly. I do a
refresh
to ensure the dataSet is up-to-date with the following statement:
iRowCount = oleDbDataAdapter1->Fill(dataSet1);
and having checked the iRowCount value I know that the dataSet has
definitely got the new rows.
So, the question is, how do I get the DataGrid to show the updated data on
the screen? There doesn't appear to be a Reload / Rebind type method in the
System.Windows.Forms.DataGrid Class. The Refresh() method doesn't do it. Any
help will be most appreciated!
Cheers
Class to show the results of a SQL query in a spreadsheet type control. The
code, which works fine is:
iRowCount = oleDbDataAdapter1->Fill(dataSet1);
dataGrid1->DataSource = dataSet1->Tables->Item[0]->DefaultView;
I then update the underlying data in the database elsewhere in the code by
adding
some new rows and
want the datagrid control to show the updated and new rows correctly. I do a
refresh
to ensure the dataSet is up-to-date with the following statement:
iRowCount = oleDbDataAdapter1->Fill(dataSet1);
and having checked the iRowCount value I know that the dataSet has
definitely got the new rows.
So, the question is, how do I get the DataGrid to show the updated data on
the screen? There doesn't appear to be a Reload / Rebind type method in the
System.Windows.Forms.DataGrid Class. The Refresh() method doesn't do it. Any
help will be most appreciated!
Cheers