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();
}
IListSource 不包含任何数据源
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e){ GridView1.EditIndex = e.NewEditIndex;bind();} \/\/删除 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e){ string sqlstr = "delete from news where n_id='" + GridView1.DataKeys[e...
asp.net编程,当我点击gridview控件时,ie状态栏上报告"网页上有错误"该...
例如,在禁用了 ViewState 的 Datagrid 中进行编辑时,只要是在 Page_Load 中第一次绑定 Datagrid 之前重新存储 EditItemIndex,且 Datagrid 处于编辑模式,那么只需将 EditItemIndex 储存到 ViewState 就够了(请参阅示例代码)。表1:Datagrid 事件与 ViewState 的依赖关系事件 是否依赖于 ViewState? 要存储在 ViewState ...
急。请教ASP C#中GridView出现的问题,谢谢各位大大,高分~求答案~谢谢...
+ ((TextBox)(GridView1.Rows[e.RowIndex].Cells[2].Controls[0])).Text.ToString().Trim() + "',性别='" + ((TextBox)(GridView1.Rows[e.RowIndex].Cells[3].Controls[0])).Text.ToString().Trim() + "'出生日期='" + ((TextBox)(GridView1.Rows[e.RowIndex].Cells[4].Controls[0]))...
我在使用gridview控件删除数据时, Comm.ExecuteNonQuery...
既然提示是语法错误,那么可以知道,是你最终拼出来的SQL有问题,那么,断点,调试,取得你最终拼出来的sql语句,然后放到查询分析器里,应该就可以很明显的看出来了,一般这种情况最常见的就是字符类型的字段给值的时候外面没加单引号''。检查下看看吧,在提示的位置附近。
删除C#中的DataSet的一条数据 和修改一条数据,怎么写?请给个例子,谢谢...
using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;public partial class admin_Maproducts : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) {...
GridView实现右键菜单
default.aspx.cs using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Text;public partial class _Default : ...
使用datagridview 进行数据的增删改查.
这样吧,我发一个GridView的增删改查的例子给你:using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using OASys.BLL;using OASys.Models;using System.Collections.Generic;public partial class _Default : System.Web.UI.Page { public ...
我用GridView分页,可是点下一页之后,上一页的按钮就不见了。怎么办?
我给你一个GridView的应用示例,你看看,希望对你有帮助:using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using OASys.BLL;using OASys.Models;using System.Collections.Generic;public partial class _Default : System.Web.UI.Page { publ...
c#.net 编译错误
将后台代码里面的 DataGrid1_Edit()这个函数的private改为protected 或者 public
System.NullReferenceException: 未将对象引用设置到对象的实例
clothing.ClothingID可能没有获取数据,你可以调试的看一下这个数据。