May 2004
Intermediate to advanced
888 pages
22h 31m
English
The DataReader can be used to retrieve schema information using the SqlDataReader.GetSchemaTable() method. This method returns a DataTable that is populated with information about a resultset’s columns. Therefore, each row in this schema resultset represents a column in the actual resultset. The schema row contains information about the column, such as its name, uniqueness, data type, and more. Listing 19.11 illustrates using this method.
1: program schemaquery; 2: 3: {$APPTYPE CONSOLE} 4: 5: {%DotNetAssemblyCompiler 'C:\windows\microsoft.net\framework\v1.1.4322\System.Data.dll'} 6: 7: uses 8: SysUtils, 9: System.Data, 10: System.Data.SqlClient, 11: System.Collections; ... |
Read now
Unlock full access