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 » UltraLite .NET 2.0 API Reference » ULConnection class » ExecuteTable methods

 

ExecuteTable(String) method

UL Ext.: Retrieves in a ULTable a database table for direct manipulation. The table is opened (sorted) using the table's primary key.

Syntax
Visual Basic

Public Function ExecuteTable( _
   ByVal tableName As String _
) As ULTable
C#

public ULTable ExecuteTable(
   string  tableName
);
Parameters
  • tableName¬†¬† The name of the table to open.

Return value

The table as a ULTable object.

Remarks

This method is a shortcut for the ULCommand.ExecuteTable() method that does not require a ULCommand instance. It is provided to help users porting from earlier versions of UltraLite.NET (it replaces iAnywhere.UltraLite.Connection.GetTable() and iAnywhere.UltraLite.Table.Open()).

Example

The following code opens the table named MyTable using the table's primary key. It assumes an open ULConnection instance called conn.

' Visual Basic
Dim t As ULTable = conn.ExecuteTable("MyTable")
' The line above is equivalent to
' Dim cmd As ULCommand = conn.CreateCommand()
' cmd.CommandText = "MyTable"
' cmd.CommandType = CommandType.TableDirect
' Dim t As ULTable = cmd.ExecuteTable()
' cmd.Dispose()
// C#
ULTable t = conn.ExecuteTable("MyTable");
// The line above is equivalent to
// ULTable t;
// using(ULCommand cmd = conn.CreateCommand())
// {
//     cmd.CommandText = "MyTable";
//     cmd.CommandType = CommandType.TableDirect;
//     t = cmd.ExecuteTable();
// }
See also