Chapter 5. Retrieving Data Using SqlDataAdapter Objects

As you learned in the previous chapter, you can use SqlCommand objects and SqlDataReader objects to execute queries and examine their results. But what if you want to store the results of a query using ADO.NET’s off-line cache, the DataSet class?

You could execute your query and then populate a DataSet with new rows by looping through the data available in a SqlDataReader until the SqlDataReader’s Read method returns False. (And don’t forget to close the SqlDataReader!) Another option is to use ...

Get Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.