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

ASP.NET
asp.net GridView控件中模板列CheckBox全选、反选、取消
asp.net GridView 删除时弹出确认对话框(包括内容提示)
asp.net DropDownList 三级联动下拉菜单实现代码
asp DataTable添加列和行的三种方法
Asp.net 页面调用javascript变量的值
asp.net 长文章通过设定的行数分页
asp.net 定时间点执行任务的简易解决办法
asp.net 页面延时五秒,跳转到另外的页面
asp.net 动态输出透明gif图片
asp.net DataList与Repeater用法区别
asp.net Javascript获取CheckBoxList的value
asp.net程序在调式和发布之间图片路径问题的解决方法
asp.net下生成英文字符数字验证码的代码
asp.net 页面版文本框智能提示JSCode (升级版)
ASP.NET URL伪静态重写实现方法
ASP.NET 2.0 中Forms安全认证
asp.net 动态添加多个用户控件
asp.net Repeater显示父子表数据,无闪烁
asp.net 无法获取的内部内容,因为该内容不是文本 的解决方法
asp.net GridView排序简单实现

ASP.NET 中的 Edit Method


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 40 ::
收藏到网摘: 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.