DataTable object represents an in-memory database table. You can add rows to a DataTable with a
SqlDataAdapter, with a
SqlDataReader, with an XML file, or programmatically. For example, the page in Listing 19.28 builds a new
DataTable programmatically. The contents of the
DataTable then display in a
GridView control (see Figure 19.14).
Figure 19.14. Displaying a
DataTable that was built programmatically.
In Listing 19.28, a
DataTable with the following three columns is ...