标题:GridView删除行错误
取消只看楼主
pietro
Rank: 1
等 级:新手上路
帖 子:54
专家分:0
注 册:2006-9-19
 问题点数:0 回复次数:1 
GridView删除行错误
GridView删除行代码如下:

string userID = this.GridView1.DataKeys[e.RowIndex].Values[0].ToString();
SqlConnection con = new SqlConnection("server=.;database=login;uid=sa;pwd=;");
con.Open();
SqlCommand cmd = new SqlCommand("delete from login where userID='" + userID + "'", con);
cmd.ExecuteNonQuery();
this.GridViewToBind();

错误提示:“System.Web.UI.WebControls.GridViewDeletedEventArgs”并不包含“RowIndex”的定义
请问那里错了,该怎么写才对???
搜索更多相关主题的帖子: GridView con userID cmd 
2006-11-17 22:10
pietro
Rank: 1
等 级:新手上路
帖 子:54
专家分:0
注 册:2006-9-19
得分:0 
能不能说详细一点,我是新手
2006-11-18 08:24



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-103720-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 2.486884 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved