| SqlCommand构造函数,它只适用了命令。在第2步,将SqlConnection对象conn赋值给SqlCommand对象cmd的连接属性。
This could have been done with the same constructor used for the insert command, with two parameters. It demonstrates that you can change the connection object assigned to a command at any time.
这同样能够用上面insert命令中使用两个参数的构造函数实现。它说明了你能够在任何时候改变赋值给命令对象的连接对象。
The ExecuteNonQuery method performs the update command.
ExecuteNonQuery方法执行更新命令。
This code is part of the UpdateData method of Listing 1 in the Putting it All Together section later in this lesson.
这些代码是表1UpdateData方法的一部分。我们将在本课后面集中介绍。
Deleting Data
删除数据
You can also delete data using the ExecuteNonQuery method. The following example shows how to delete a record from a data base with the ExecuteNonQuery method:
你同样能够使用 上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >> |