我想在本地执行插入,更新,删除操作 [英] I want to perform insert ,update ,delete operation locally

查看:90
本文介绍了我想在本地执行插入,更新,删除操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想在本地执行插入,更新,删除操作(仅在页面上)这些更改不应该反映在数据库上,直到点击更新按钮但是当用户
$ b时$ b点击更新按钮所有更改应反映在数据库上。

解决方案

您可以在不更新数据库的情况下显示本地数据的样子。这将涉及跟踪一系列事件,并立即执行所有事件。您可以在会话中存储数据源的副本,以及要执行的操作列表。这将是凌乱的,而且大多是毫无意义的IMO。


http://www.aspdotnetcodes.com/ GridView_Insert_Edit_Update_Delete.aspx [ ^ ]



插入,更新,在ASP.NET Gridview中删除,将DataSource删除为SQL Server,MS Access(mdb / accdb),XML和Framework为2.0 / 3.0 / 3.5 / 4.0(VS 2005/2008/2010) [ ^ ]


您需要在某些对象中保存记录/数据表,例如 Session 。然后,您可以在该数据表中执行插入/更新/删除操作。点击最后保存只需更新数据库表中的值即可。这是我的文章。

将DataTable发送到存储过程 [ ^ ]





这将对您有所帮助。

- -Amit

Hi,
I want to perform insert ,update ,delete operation locally (on page only ) these changes should not reflect on database until click on update button but when user
click on update button all changes should reflect on database.

解决方案

You can show what the data would look like locally, without updating to the database. That would involve keeping track of a sequence of events, and performing them all at once. you could store a copy of the data source in your session, along with a list of actions to perform. It would be messy and mostly pointless IMO.


http://www.aspdotnetcodes.com/GridView_Insert_Edit_Update_Delete.aspx[^]

Insert, Update, Delete in ASP.NET Gridview, DataSource as SQL Server, MS Access (mdb/accdb), XML and Framework as 2.0 / 3.0 / 3.5 / 4.0 (VS 2005/2008/2010)[^]


You need to save the records/datatable in some objects like "Session". Then you can perform insert/update/delete operation in that datatable. On click of final save just update the values in database table. Here is my article to do that.
Sending DataTable to a Stored Procedure[^]


This will help you.
--Amit


这篇关于我想在本地执行插入,更新,删除操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆