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”的定义
请问那里错了,该怎么写才对???