Rick Lederman said:
Is a DataSet.Clear required before new data is brought into the dataset? --It depends.
I.E. daMyDataset.Fill(dsMyDataset)
Can I simply refill the dataset with new data intended to totally replace
the old data, or must I do a .Clear first?
If you have a Key on the Table and you use the same query, then you can
refresh it. However if youdon't have a key on the table, then it will add
duplicates of the rows.
http://msdn.microsoft.com/library/d...stemdatacommondbdataadapterclassfilltopic.asp
Here's a summary of the rules to have it refresh vs fill over again:
When using subsequent Fill calls to refresh the contents of the DataSet, two
conditions must be met:
1.. The SQL statement should match the one initially used to populate the
DataSet.
2.. The Key column information must be present.
If primary key information is present, any duplicate rows are reconciled and
only appears once in the DataTable that corresponds to the DataSet. Primary
key information may be set either through FillSchema, by specifying the
PrimaryKey property of the DataTable, or by setting the MissingSchemaAction
property to AddWithKey.