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

SQL Anywhere 11.0.1 (日本語) » Ultra Light - .NET プログラミング » Ultra Light .NET 2.0 API リファレンス » ULConnection クラス » ExecuteTable メソッド

 

ExecuteTable(String) メソッド

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();
// }
参照