在GridView中插入/更新值 [英] Insert/Update values in a gridview

查看:123
本文介绍了在GridView中插入/更新值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是插入/更新在网格视图中的值的最佳方式
在点击某个地方保存按钮。
在页面中。
我不希望这样的喜欢用插入项目模板EditItemTemplate中。

What would be the best way to Insert/Update the values in a Grid view on clicking a save button placed somewhere. in the page . I dont want that to be done like Using Insert Item template and EditItemTemplate.

我的想法:
通过的GridView的每一行环路和
连接到数据库
执行命令
并关闭连接。

My thought: "Loop through each row of Gridview and connecting to database and execute the command and close the connection."

或者是有什么办法,使我们可以连接到数据库只有一次,并执行
INSERT / UPDATE操作。

Or is there any way so that we can connect to database only once and perform Insert/Update operations.

任何建议,将AP preciated ..

any suggestions would be appreciated..

在此先感谢。

推荐答案

可以在这些文章可以帮助您:

May these articles help you:

  • Bulk Edit with GridView
  • Edit Update Multiple Records/Rows In Gridview With Checkbox ASP.NET

有许多相关文章:

  • Editable GridView in ASP.NET 2.0
  • ASP.NET GridView - Add a new record
  • Insert, Update, Delete with Gridview....simple way

这篇关于在GridView中插入/更新值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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