Hey!
I have a function in which a dataAdapter fills a dataset from a stored procedure. The dataset tables have their primary keys set. This function is called repetitively every few seconds. The number of records returned from the stored proceduremay change based on certain conditions and parameters. The dataSet is bound to a dataGrid in the UI
My problem goes as follows; assuming the first callto the SPreturned 10 records, which are now loaded in the dataTable, and then the second call returned only 8 records, thedatatable will update those 8 recordsbut willNOT remove the extra 2. They will stay in the dataTable.I need to figure a way to make sure that the data in the dataTable exactly reflects what is returned from the SP.
Clearing the dataTable is not an option, for this will cause the datagrid bound to this datatable to flicker every few seconds.
I tried changing the rowState of the extra records in the dataTable to "deleted", and it worked! But the problem here is that marking them as "deleted" will not remove them from the dataTable, and I need to keep the dataTable as small as possible (for performance reasons).
Any ideas?
Thanks