All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
Sql,server表面区域配置工具保服务_[SQL,Server教程]
关于HTTP及XMLHTTP状态代码一览_[XML教程]
asp.net的web打印功能简单实现_[Asp.Net教程]
用于GridView自定义分页的几种存储过程写法_[Asp.Net教程]
维护为SQL,Server保驾护航_[SQL,Server教程]
VBScript实现对Windows注册表的修改_JavaScript技术_编程技术
如何利用SQL查询返回庞大的整数序列表_[SQL Server教程]
PHP技巧:动态网页技术PHP中关于类的几点使用技巧_[PHP教程]
SQL2005其中三个版本的比较_[SQL,Server教程]
ASP.NET,2.0,树型数据的显示源代码(递归)_[Asp.Net教程]
Reading number is top 10 pictures
Household design of gorgeous series
NeedWallpaper5
Take you to walk into the most true north Korea rural3
移民小国也实惠2
30 beautiful school beauty2
八个盛产美女的国家1
India's national beauty of the college students
美女就是美女
Startling Russian girl blind date scene1
The real super beauty1
Download software ranking
jdk1.6 for windows
天龙八部最新服务端
C#COM编程指南
The cock of the Grosvenor LTD handsome
双旗镇刀客A
仙剑奇侠传98版歌曲
WebService在.NET中的实战应用教学视频 → 第1集
Prostitutes diary
C#高级编程(第4版)
SP3 for SQL2000
delv published in(发表于) 2014/1/16 9:30:35 Edit(编辑)
一次编辑,GridView,的所有行_[Asp.Net教程]

一次编辑,GridView,的所有行_[Asp.Net教程]

一次编辑 GridView 的所有行_[Asp.Net教程]























在平时的实际项目中,为了减少往返提交数据,可以一次编辑 GridView 的所有行,这样大大提高用户使用产品的体验。下面就讲解何一次编辑 GridView 的所有数据行。在下面的例子中,数据库使用《ASP.NET 2.0应用开发技术》一书中Site\App_Data\下的 ASPNET20Book.mdb 数据库。例子中的数据更新方式使用 SqlDataSource 数据源控件的UpdateCommand属性,但此方法同样适用于存储过程,SQL 语句等。







C#




<%@ Page Language="C#" Debug="true" %>






同时编辑 GridView的 多行



DataKeyNames="id" DataSourceID="SqlDataSource1" OnRowDataBound="GridView1_RowDataBound"
OnRowCreated="GridView1_RowCreated">























ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\ASPNET20Book.mdb;Persist Security Info=True"
ProviderName="System.Data.OleDb" SelectCommand="SELECT * FROM [Student]"
UpdateCommand="Update [Student] Set Title = @Title,Gender = @Gender,ClassName=@ClassName Where id=@id">

onClick="XianhuiMeng_Click" />





注意:对于SQL Server 数据库,参数名字不加@。另外注意:不同数据库类型和不同的数据源,UpdateCommand="Update [Student] Set Title = @Title,Gender = @Gender,ClassName=@ClassName Where id=@id"写法和SqlDataSource1.UpdateParameters.Add(new Parameter("@Title", TypeCode.String, ((TextBox)gvr.FindControl("txtTitle")).Text)); 的写法会有所区别。




来源:孟宪会之精彩世界













































添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.