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

SQL Anywhere 11.0.1 (中文) » UltraLite - .NET 编程 » UltraLite .NET 2.0 API 参考 » ULCommandBuilder 类 » GetInsertCommand 方法

 

GetInsertCommand(Boolean) 方法

获取自动生成的、执行数据库插入操作所需的 ULCommand 对象。

语法
Visual Basic
Public Function GetInsertCommand( _
   ByVal useColumnsForParameterNames As Boolean _
) As ULCommand
C#
public ULCommand GetInsertCommand(
   bool useColumnsForParameterNames
);
参数
  • useColumnsForParameterNames   如果为 true,则在可能的情况下生成与列名匹配的参数名。如果为 false,则生成 @p1、@p2 等等。

返回值

自动生成的、执行插入操作所需的 ULCommand 对象。

注释

首先生成 SQL 语句后,如果应用程序以任何方式对 ULDataAdapter.SelectCommand 进行了更改,则它必须显式调用 DbCommandBuilder.RefreshSchema。否则,GetInsertCommand 方法会继续使用来自上一条语句的信息,而该信息可能是不正确的。当应用程序调用 DbDataAdapter.Update(System.Data.DataSet) 或 GetInsertCommand 方法时,会首先生成 SQL 语句。

另请参见