O'Reilly logo

Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition by David Sceppa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Questions That Should Be Asked More Frequently

Q

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?

A

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required