CS1061: “System.Web.UI.WebControls.GridViewEditEventArgs”不包含“RowIndex”的定义。求大神解答!
CS1061:“System.Web.UI.WebControls.GridViewEditEventArgs”不包含“RowIndex”的定义,并且找不到可接受类型为“...
CS1061: “System.Web.UI.WebControls.GridViewEditEventArgs”不包含“RowIndex”的定义,并且找不到可接受类型为“System.Web.UI.WebControls.GridViewEditEventArgs”的第一个参数的扩展方法“RowIndex”(是否缺少 using 指令或程序集引用?)
命名空间
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
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;
事件
protected void sqlsource01_RowDeleting(object sender, GridViewEditEventArgs e)
{
string sqlsrt = ConfigurationManager.ConnectionStrings["Accert_m"].ConnectionString;
SqlConnection conn = new SqlConnection(sqlsrt);
//string key_id = "DataKeys[e.RowIndex].Values[0].ToString()";
string sql_gridv_dele = "delete from pc_table where pc_id='" + sqlsource01.DataKeys[e.RowIndex].Value.ToString() + "'";
conn.Open();
SqlCommand delete_commd = new SqlCommand(sql_gridv_dele,conn);
delete_commd.ExecuteNonQuery();
conn.Close();
datasoutce();
} 展开
命名空间
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
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;
事件
protected void sqlsource01_RowDeleting(object sender, GridViewEditEventArgs e)
{
string sqlsrt = ConfigurationManager.ConnectionStrings["Accert_m"].ConnectionString;
SqlConnection conn = new SqlConnection(sqlsrt);
//string key_id = "DataKeys[e.RowIndex].Values[0].ToString()";
string sql_gridv_dele = "delete from pc_table where pc_id='" + sqlsource01.DataKeys[e.RowIndex].Value.ToString() + "'";
conn.Open();
SqlCommand delete_commd = new SqlCommand(sql_gridv_dele,conn);
delete_commd.ExecuteNonQuery();
conn.Close();
datasoutce();
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询