core.dll. This is to make DataSet query capabilities
easier. Once DataSets are loaded with data, we can begin querying them just as we
do against the database tables using database queries. It is just another source of data
for LINQ, similar to an XML data source. We can query a single table or multiple
tables in a DataSet using join and groupby operators. If the schema of DataSet
is known at the application design time, we can use typed DataSet for the queries
which will be easier and will be more readable.
Chapter 5
[ 149 ]
Some of the DataSet query operators used, are explained in the following sections.
CopyToDataTable
This operator is used for creating a new DataTable from the query. The properties
are taken as DataColumns, and the field values are iterated and converted as data
values for the columns. Following is the query which refers to dataSetDeserts in
the Items table in the DataSet. CopyToDataTable operator is applied on the query
to convert it to a DataTable.
var items = dataSetDeserts.
Pages:
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234