UL Ext.: 在 ULTable 中检索数据库表以便直接进行操作。使用指定的索引打开(排序)该表。
Visual Basic Public Function ExecuteTable( _ ByVal tableName As String, _ ByVal indexName As String _ ) As ULTable
C# public ULTable ExecuteTable( string tableName, string indexName );
tableName 要打开的表的名称。
indexName 用于打开(排序)表的索引名称。
ULTable 对象形式的表。
此方法为 ULCommand.ExecuteTable() 方法的快捷方式,它不需要 ULCommand 实例。提供此方法是为了帮助用户从较早的 UltraLite.NET 版本进行移植(它替换了 iAnywhere.UltraLite.Connection.GetTable() 和 iAnywhere.UltraLite.Table.Open())。
以下代码会使用名为 MyIndex 的索引打开名为 MyTable 的表。它假定已打开了一个名为 conn 的 ULConnection 实例。
' Visual Basic Dim t As ULTable = conn.ExecuteTable("MyTable", "MyIndex") ' The line above is equivalent to ' Dim cmd As ULCommand = conn.CreateCommand() ' cmd.CommandText = "MyTable" ' cmd.IndexName = "MyIndex" ' cmd.CommandType = CommandType.TableDirect ' Dim t As ULTable = cmd.ExecuteTable() ' cmd.Dispose() |
// C# ULTable t = conn.ExecuteTable("MyTable", "MyIndex"); // The line above is equivalent to // ULTable t; // using(ULCommand cmd = conn.CreateCommand()) // { // cmd.CommandText = "MyTable"; // cmd.IndexName = "MyIndex"; // cmd.CommandType = CommandType.TableDirect; // t = cmd.ExecuteTable(); // } |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |