当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > Edit Method

ASP.NET
使用NUnit进行单元测试
[FxCop.设计规则]1. 抽象类不应该拥有构造函数
遍历XML文档返回二维数组(ASP)(更新版)
c#中的interface abstract与virtual
[VB.NET] Single & Double
asp.net验证码生成类(参考)
JAVA开发者应该去的20个英文网站 [摘]
C#中关于GDI+输出的问题
XML 命名空间提供了一种避免元素命名冲突的方法。
VS.NET 2005 Beta 2初体验(3)—操作SQL Mobile数据库
VS.NET 2005 Beta 2初体验(1)-用C#开发Managed代码
VS.NET 2005 Beta 2初体验(2)-用C++开发Native代码
VS.NET 2005 Beta2初体验(4)-Notification控件
XmlHttp异步获取网站数据的例子
利用C#编写一个简单的抓网页应用程序
C#中结构与类的区别
在.NET中实现彩色光标,动画光标和自定义光标
C#2.0新特性探究之模拟泛型和内置算法
C#2.0 新特性探究之委托与匿名委托
获取本机的本地上网IP地址

ASP.NET 中的 Edit Method


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 61 ::
收藏到网摘: n/a


Copies the current record from an updatable Recordset object to the copy buffer for subsequent editing.
Syntax
recordset.Edit
The recordset placeholder represents an open, updatable Recordset object that contains the record you want to edit.
Remarks
Once you use the Edit method, changes made to the current record's fields are copied to the copy buffer. After you make the desired changes to the record, use the Update method to save your changes.
The current record remains current after you use Edit.
Caution If you edit a record and then perform any operation that moves to another record, but without first using Update, your changes are lost without warning. In addition, if you close recordset or end the procedure which declares the Recordset or the parent Database or Connection object, your edited record is discarded without warning.
Using Edit produces an error if:

?There is no current record.?The Connection, Database, or Recordset object was opened as read-only.?No fields in the record are updatable.?The Database or Recordset was opened for exclusive use by another user (Microsoft Jet workspace).?Another user has locked the page containing your record (Microsoft Jet workspace).
In a Microsoft Jet workspace, when the Recordset object's LockEdits property setting is True (pessimistically locked) in a multiuser environment, the record remains locked from the time Edit is used until the update is complete. If the LockEdits property setting is False (optimistically locked), the record is locked and compared with the pre-edited record just before it's updated in the database. If the record has changed since you used the Edit method, the Update operation fails with a run-time error if you use OpenRecordset without specifying dbSeeChanges. By default, Microsoft Jet-connected ODBC and installable ISAM databases always use optimistic locking.
In an ODBCDirect workspace, once you edit (and use Update to update) a record抯 primary key field, you can no longer edit fields in that record until you close the Recordset, and then retrieve the record again in a subsequent query.
Note To add, edit, or delete a record, there must be a unique index on the record in the underlying data source. If not, a "Permission denied" error will occur on the AddNew, Delete, or Edit method call in a Microsoft Jet workspace, or an "Invalid argument" error will occur on the Update call in an ODBCDirect workspace.