Execute a SELECT statement to retrieve information from an UltraLite database and handle the result set that is returned.
Prerequisites
There are no prerequisites for this task.
Declare a ULCommand object to holds the query.
ULCommand cmd; |
Assign a statement to the object.
cmd = conn.CreateCommand(); cmd.CommandText = "SELECT MyColumn FROM MyTable"; |
Execute the statement.
Query results can be returned as one of several types of objects. In this example, a ULDataReader object is used.
ULDataReader customerNames = cmd.ExecuteReader(); int fc = customerNames.GetFieldCount(); while( customerNames.MoveNext() ) { for ( int i = 0; i < fc; i++ ) { System.Console.Write(customerNames.GetString( i ) + " " ); } System.Console.WriteLine(); } |
![]() |
Discuss this page in DocCommentXchange.
|
Copyright © 2014, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0 |