tags:

views:

94

answers:

1

Not sure if I have the correct subject line. Here is my issue. I have a form with 2 GridView. One GridView has a list of all zipCodes. The users is to select a location from a dropdown list, then select the zipcodes he/she wants to be assigned to that location and then click the "Add" button. The zipcodes then appear in the second GridView. When the user clicks the "Save" button, the data is sent to the database. The is also a "Remove" to remove zipcode(s) in the second GridView.

How do I track changes only in the second GridView. There could be 1000's of zipcode in the second GridView. Do I just remove and re-insert the list for that location evertime the user click save? I was thinking of using a DataSet, add DataRows and then update, however I am not using a DataAdapter to load my dataset, so there is no way for me to use DataAdapter.Update(ds). I am using the SQLHelper.ExecuteDataset(parms)

Any ideas?

Anyone?

+2  A: 

Forget Dataset. Dataset is a nightmare. Instead use a BindingList.

Ray
+1 almost anything that is prefixed with the word "Data" and is an collection class from Microsoft needs to be avoided like the plague.
Chris Marisic
is it normal for it to take about 45 sec to add 40000 items to the list?
Saif Khan
Check with profiler (like dotTrace) which code is a bottleneck. But speaking generaly it's better to use paging of the resultset, or a grid in a virtual mode (loading rows on demand) instead of preloading a whole lot of them in one piece.
Ray