Understanding UltraLite.NET Development
Accessing and manipulating data using dynamic SQL
The ULDataReader.GetSchemaTable method and ULDataReader.Schema property (iAnywhere.Data.UltraLite namespace), or the ResultSet.Schema property (iAnywhere.UltraLite namespace) allows you to retrieve information about a result set, such as column names, total number of columns, column scales, column sizes and column SQL types.
The following example demonstrates how to use the ULDataReader.Schema and ResultSet.Schema properties to display schema information in a console window.
// iAnywhere.Data.UltraLite namespace
for ( int i = 0;
i < MyResultSet.Schema.GetColumnCount();
i++ ) {
System.Console.WriteLine(
MyResultSet.Schema.GetColumnName(i) + " " +
MyResultSet.Schema.GetColumnSQLType(i)
);
}// iAnywhere.UltraLite namespace
for ( int i = 1;
i <= MyResultSet.Schema.GetColumnCount();
i++ ) {
System.Console.WriteLine(
MyResultSet.Schema.GetColumnName(i) + " " +
MyResultSet.Schema.GetColumnSQLType(i)
);
}SQL Anywhere Studio 9.0.2
Copyright © 1989–2004 Sybase, Inc. Portions copyright © 2001–2004 iAnywhere Solutions, Inc. All rights reserved.