Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
获取自动生成的、执行数据库删除操作所需的 ULCommand 对象。
Public Shadows Function GetDeleteCommand( ByVal useColumnsForParameterNames As Boolean ) As ULCommand
public new ULCommand GetDeleteCommand(bool useColumnsForParameterNames)
useColumnsForParameterNames 如果为 true,则在可能的情况下生成与列名匹配的参数名。如果为 false,则生成 @p1、@p2 等参数名。
自动生成的、执行删除操作所需的 ULCommand 对象。
InvalidOperationException DbCommandBuilder.DataAdapter 尚未初始化。DataAdapter.SelectCommand 属性尚未初始化。DataAdapter.SelectCommand.Connection 属性尚未初始化。不支持针对多个基表的动态 SQL 生成。不支持针对包含重复列的 SelectCommand 的动态 SQL 生成。不支持针对未返回任何键列信息的 SelectCommand 的动态 SQL 生成。
首先生成 SQL 语句后,如果应用程序以任何方式对 ULDataAdapter.SelectCommand 进行了更改,则它必须显式调用 DbCommandBuilder.RefreshSchema。否则,GetDeleteCommand 方法会继续使用来自上一条语句的信息,而该信息可能是不正确的。当应用程序调用 DbDataAdapter.Update(System.Data.DataSet) 或 GetDeleteCommand 方法时,会首先生成 SQL 语句。