UL Ext: Retrieves, with the specified command behavior, a database table for direct manipulation.
Public Function ExecuteTable(
ByVal tableName As String,
ByVal indexName As String,
ByVal cmdBehavior As CommandBehavior
) As ULTable
public ULTable ExecuteTable(
string tableName,
string indexName,
CommandBehavior cmdBehavior
)
tableName The name of the table to open.
indexName The name of the index with which to open (sort) the table.
cmdBehavior A bitwise combination of System.Data.CommandBehavior flags describing the results of the query and its effect on the connection. UltraLite.NET respects only the System.Data.CommandBehavior.Default, System.Data.CommandBehavior.CloseConnection, and System.Data.CommandBehavior.SchemaOnly flags.
The table as a ULTable object.
ULException class A SQL error occurred.
InvalidOperationException The tableName is invalid.
The table is opened (sorted) using the specified index.
This method is a shortcut for the ULCommand.ExecuteTable(System.Data.CommandBehavior) method that does not require a ULCommand object. It is provided to help users porting from earlier versions of UltraLite.NET (it replaces iAnywhere.UltraLite.Connection.GetTable and iAnywhere.UltraLite.Table.Open methods).
The following code opens the table named MyTable using the index named MyIndex. It assumes an open ULConnection object named conn.
' Visual Basic Dim t As ULTable = conn.ExecuteTable( _ "MyTable", "MyIndex", CommandBehavior.Default _ ) ' The line above is equivalent to the following code: ' Dim cmd As ULCommand = conn.CreateCommand() ' cmd.CommandText = "MyTable" ' cmd.IndexName = "MyIndex" ' cmd.CommandType = CommandType.TableDirect ' Dim t As ULTable = cmd.ExecuteTable(CommandBehavior.Default) ' cmd.Dispose() |
The following code is the C# language equivalent:
// C# ULTable t = conn.ExecuteTable( "MyTable", "MyIndex", CommandBehavior.Default ); // The line above is equivalent to the following code: // ULTable t; // using(ULCommand cmd = conn.CreateCommand()) // { // cmd.CommandText = "MyTable"; // cmd.IndexName = "MyIndex"; // cmd.CommandType = CommandType.TableDirect; // t = cmd.ExecuteTable(CommandBehavior.Default); // } |
![]() |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |