It depends if you're using an DataAdapter to fill in the DataSet. Suppose
you have a SqlDataAdapter (let's say the variable name is "da") in your
class' designer (added by drag-and-drop from toolbox), just configure it to
also generate INSERT/DELETE/UPDATE statements, and use
da.Update(DataSetClientReg);
to update the whole DataSet back to the db. As long as the
INSERT/DELETE/UPDATE statements are correct, this is the easiest way.
If you create your own SqlDataAdapter, though, you've got some more stuff to
do. You got to new a SqlCommand object (with the SqlConnection object, of
course), add parameters for every column, and assign this SqlCommand to the
UpdateCommand property of the SqlDataAdapter. For this I'm not very
experienced with it, please refer to MSDN for how to write SqlCommand
objects for Update.
Hope it helps.
|