UL 拡張:直接の操作用に、ULTable にデータベース・テーブルを取り出します。テーブルのプライマリ・キーを使用して、テーブルが開かれます (ソートされます)。
Visual Basic Public Function ExecuteTable( _ ByVal tableName As String _ ) As ULTable
C# public ULTable ExecuteTable( string tableName );
tableName 開くテーブルの名前。
ULTable オブジェクトとして返されるテーブル。
このメソッドは、ULCommand インスタンスを必要としない ULCommand.ExecuteTable() メソッドのショートカットです。また、以前のバージョンの Ultra Light.NET から移行できるようにするために用意されています (iAnywhere.UltraLite.Connection.GetTable() と iAnywhere.UltraLite.Table.Open() が置き換えられます)。
次のコードでは、テーブルのプライマリ・キーを使用して MyTable というテーブルが開かれます。また、conn という開いた ULConnection インスタンスが想定されています。
' 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(); // } |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |