April 2002
Intermediate to advanced
416 pages
11h 50m
English
If you know that a table exists in a database, learning about the fields it contains is relatively easy. The following sections describe several ways a program can obtain information about the table’s fields.
One method to get information about a table’s fields is to use a data adapter to fill a DataTable with the results of the query SELECT * FROM table_name . The DataTable object’s Columns collection contains information about the table even if the query returns no records.
Example program TableColumns, shown in Figure 13.1, demonstrates this technique. The program uses the code in Listing 13.1 to display information about a table’s columns.
Read now
Unlock full access