So the SqlDataAdapter can fill a DataSet with the results of a query and submit changes stored in a DataSet to my database. Do I have to use the same object to accomplish both tasks? I’m working with multi-tiered applications, and it sounds like I need to keep my SqlDataAdapter objects alive in the middle tier between calls from the client application. Is that the case?
You can use the same SqlDataAdapter to fill your DataSet and submit changes to your database, but that’s not a requirement.
Suppose that your middle-tier object has two simple methods—one to return a new DataSet and one to submit the pending changes in your DataSet to your database. You can use separate SqlDataAdapter objects for each ...