May 2010
Intermediate to advanced
1272 pages
61h 18m
English
CopyToDataTableTables from databases are represented within datasets via DataTable objects. You can create custom tables in code using a special extension method named CopyToDataTable which can convert from EnumerableRowCollection (Of T) into a new DataTable. For example, imagine you want to create a subset of orders from the Orders table and that you want to create a new table with this subset of information. The following code accomplishes this:

The query retrieves only the orders where the ShipCountry property contains something and creates a new DataTable with this piece of information. The query variable’s type is DataTable ...
Read now
Unlock full access