Updating Multiple DataTables inside one Dataset
I have been working on a generic helper class that, among other database services, will take a modified dataset that contains multiple modified datatables and do an update. Long story made real short, all worked well on the first DataTable update, but not the following ones. The Command was getting built correctly, however I kept getting exceptions that informed me the parameter passed in was not a member of the stored proc (the code builds the sproc name dynamically per the Datatable info).
Well, it seems you have to call:
e.Command.Parameters.Clear()
in the
OnRowUpdated DataAdapter event
where e = SqlRowUpdatedEventArgs
If you do not call this, the param list just grows and grows as you call update.