Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » UltraLite - .NET Programming » Understanding UltraLite.NET Development » Accessing and manipulating data with the Table API

Accessing and manipulating data with the Table API Next Page

Navigating the rows of a table


UltraLite.NET provides you with a number of methods to navigate a table to perform a wide range of navigation tasks.

The table object provides you with the following methods to navigate a table.

Example

The following code opens the MyTable table and displays the value of the MyColumn column for each row.

ULTable t = conn.ExecuteTable( "MyTable" );
int colID = t.GetOrdinal( "MyColumn" );
while ( t.MoveNext() ){
   System.Console.WriteLine( t.GetString( colID ) );
}

You expose the rows of the table to the application when you open the table object. By default, the rows are ordered by primary key value, but you can specify an index when opening a table to access the rows in a particular order.

Example

The following code moves to the first row of the MyTable table as ordered by the ix_col index.

ULTable t = conn.ExecuteTable( "MyTable", "ix_col" );
t.MoveFirst();

See ULTable class and ULTableSchema class.