Returning Data Using a Dataset

Another way to return tabular data from a Web service is to return it as an ADO.NET dataset. Just like ADO Recordsets, you can fabricate a dataset from in-memory data that does not come from a database. To understand how to do this, let's first look at the object model for ADO.NET datasets, which is shown in Figure 10-15.

Figure 10-15. The object model for ADO.NET datasets.

As you can see, a dataset is a collection of data tables. A data table is actually the equivalent of an ADO Recordset; it contains columns and rows. To create a fabricated Dataset, you first need to add a data table to the dataset using the Add ...

Get .NET and COM Interoperability Handbook, The 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.