DB2CommandBuilder.GetUpdateCommand 方法
获取在数据库中执行更新所需的自动生成的 DB2Command 对象。
- 名称空间:
IBM.Data.DB2- 组合件:
IBM.Data.DB2(在IBM.Data.DB2.dll中)
语法
[Visual Basic]
Public Function GetUpdateCommand() As DB2Command
[C#]
public DB2Command
GetUpdateCommand();
[C++]
public: DB2Command
* GetUpdateCommand();
[JScript]
public function GetUpdateCommand() : DB2Command
;
返回值
执行更新所需的自动生成的 DB2®命令 对象。
备注
您可以将 GetUpdateCommand 方法用于参考或故障诊断目的,因为它返回要执行的 DB2命令 对象。 您还可以使用 GetUpdateCommand 来更新 DB2数据适配器中的行。
还可以将 GetUpdateCommand 用作已修改命令的基础。 例如,您可以调用 GetUpdateCommand 并修改 DB2Command.CommandTimeout 值,然后在 DB2DataAdapter 上显式设置该值。
首次生成 SQL 语句后,如果以任何方式更改该语句,那么必须显式调用 RefreshSchema 。 否则,GetUpdateCommand 仍将使用来自先前语句的信息,该信息可能不正确。 当应用程序调用 Update 或 GetUpdateCommand 时,将第一次生成 SQL 语句。