Execute a SELECT statement to retrieve information from an UltraLite database and handle the result set that is returned.
Prérequis
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(); } |
![]() |
Discuter à propos de cette page dans DocCommentXchange.
|
Copyright © 2013, SAP AG ou société affiliée SAP - SAP Sybase SQL Anywhere 16.0 |