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

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

 

Updating rows

The following procedure describes how to update a row.

To update a row

  1. Move to the row you want to update.

    You can move to a row by scrolling through the table or by searching the table using find or lookup methods.

  2. Enter update mode.

    For example, the following instruction enters update mode on table t.

    t.BeginUpdate();
  3. Set the new values for the row to be updated.

    For example, the following instruction sets the id column in the buffer to 3.

    t.SetInt( id , 3);
  4. Execute the Update.

    t.Update();

After the update operation, the current row is the row that has been updated. If you changed the value of a column in the index specified when the Table object was opened, the current row is undefined.

By default, UltraLite.NET operates in AutoCommit mode, so that the update is immediately applied to the row in permanent storage. If you have disabled AutoCommit mode, the update is not applied until you execute a commit operation. See Managing transactions.

Caution

You cannot update the primary key value of a row: delete the row and add a new row instead.