Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
执行一条不返回结果集的语句,如 SQL INSERT、DELETE 或 UPDATE 语句。
Public Overrides Function ExecuteNonQuery() As Integer
public override int ExecuteNonQuery()
受影响的行数。
ULException 类 发生 SQL 错误。
InvalidOperationException 该命令处于无效状态。ULCommand.Connection 对象缺失或关闭、ULCommand.Transaction 值与连接的当前事务状态不匹配,或者 ULCommand.CommandText 值无效。
该语句就是当前的 ULCommand 对象,它具有必需的 ULCommand.CommandText 和任何 ULCommand.Parameters 值。
如果是 UPDATE、INSERT 和 DELETE 语句,返回值将是受该命令影响的行数。对于所有其它类型的语句和回退,返回值将是 -1。
ULCommand.CommandType 属性不能为 System.Data.CommandType.TableDirect。