ASA Programming Guide
Developing Applications with the .NET Data Provider
Accessing and manipulating data
Using the AsaCommand object to retrieve and manipulate data
You can obtain schema information about columns in the result set.
If you are using the AsaDataReader, you can use the GetSchemaTable method to obtain information about the result set. The GetSchemaTable method returns the standard .NET DataTable object, which provides information about all the columns in the result set, including column properties.
For more information about the GetSchemaTable method, see GetSchemaTable method.
To obtain information about a result set using the GetSchemaTable method
Declare and initialize a connection object.
AsaConnection conn = new AsaConnection( c_connStr );
Open the connection.
conn.Open();
Create an AsaCommand object with the SELECT statement you want to use. The schema is returned for the result set of this query.
AsaCommand cmd = new AsaCommand( "SELECT * FROM employee", conn );
Create an AsaDataReader object and execute the Command object you created.
AsaDataReader dr = cmd.ExecuteReader();
Fill the DataTable with the schema from the data source.
DataTable schema = dr.GetSchemaTable();
Close the AsaDataReader and AsaConnection objects.
dr.Close(); conn.Close();
Bind the DataTable to the grid on the screen.
dataGrid.DataSource = schema;