CS1061:"System.EventArgs"不包含"RowIndex"的定义,
usingSystem.Collections;usingSystem.Configuration;usingSystem.Data;usingSystem.Linq;并...
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
并且找不到可接受类型为"System.EventArgs"的第一个参数的扩展方法"RowIndex"(是否缺少using指令或程序集引用?)
前台如下
代码如下
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class 还书 : System.Web.UI.Page
{
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
string StuID = Session["cardid"].ToString();
string CourseClassID = this.GridView1.Rows[e.RowIndex].Cells[1].Text.ToString();
Response.Write(CourseClassID);
SqlConnection DeleteConn = new SqlConnection();
DeleteConn.ConnectionString = ConfigurationManager.ConnectionStrings["ConnStr"].ToString();
DeleteConn.Open();
SqlCommand DeleteCmd = new SqlCommand("DELETE FROM borrow WHERE cardid='" + StuID + "'" + " AND bookid'" + CourseClassID + "'", DeleteConn);
DeleteCmd.ExecuteNonQuery();
DeleteConn.Close();
Response.Write("<script language='javascript'>alert('还书成功!');</script>");
}
} 展开
using System.Configuration;
using System.Data;
using System.Linq;
并且找不到可接受类型为"System.EventArgs"的第一个参数的扩展方法"RowIndex"(是否缺少using指令或程序集引用?)
前台如下
代码如下
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class 还书 : System.Web.UI.Page
{
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
string StuID = Session["cardid"].ToString();
string CourseClassID = this.GridView1.Rows[e.RowIndex].Cells[1].Text.ToString();
Response.Write(CourseClassID);
SqlConnection DeleteConn = new SqlConnection();
DeleteConn.ConnectionString = ConfigurationManager.ConnectionStrings["ConnStr"].ToString();
DeleteConn.Open();
SqlCommand DeleteCmd = new SqlCommand("DELETE FROM borrow WHERE cardid='" + StuID + "'" + " AND bookid'" + CourseClassID + "'", DeleteConn);
DeleteCmd.ExecuteNonQuery();
DeleteConn.Close();
Response.Write("<script language='javascript'>alert('还书成功!');</script>");
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询