DataGrid上的'删除' 提示错误,代码. 看错误应该是insert的时候主键重复,你的表中是不是用了触发器? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 那就是你触发器的问题了,看看你的触发器的代码是不是在'dbo.nb_JiaBanLog' 这个表的插入上写错了!其实你可以考虑在程序里面写入这个表而不弄个触发器! cmd.ExecuteNonQuery();con.close();--------------这里加上这句 SqlDataAdapter ada=new SqlDataAdapter("select * from nb_JiaBanLog where FormNumber= "+this.jb_FormNumber.Text,Con);//"select * from nb_JiaBanLog where FormNumber= "+this.jb_FormNumber.Text,Con DataSet ds=new DataSet(); ada.Fill(ds); DataGrid1.DataSource=ds; this.DataGrid1.DataBind(); Con.Close(); 表的主外键,你这样删不了的,要去掉主外键,或者你sql语句有问题,删的地方不对 在 DataGrid 中 ItemTemplate 获得 Lable 值 ASP.NET 方法调用 在使用WCF的过程中,是不是在底层一定会建立Socket通信 一个很急的问题,关于access权限问题 关于vs2005单元测试的问题 怎样在数据访问层中使用Server.HtmlDecode()方法? 自动生成的TextBox控件,放在了<Table>中,现在要提取TextBox中的输入,该怎么办,up有分 DataList控件里面的按钮控件怎么添加动作啊??? 如何用C#提取网页的所有内容(包括链接和文字内容) 可以帮我吗? 取出字符串中的子字符串 是高手就帮忙解决一下
con.close();--------------这里加上这句
SqlDataAdapter ada=new SqlDataAdapter("select * from nb_JiaBanLog where FormNumber= "+this.jb_FormNumber.Text,Con);//"select * from nb_JiaBanLog where FormNumber= "+this.jb_FormNumber.Text,Con
DataSet ds=new DataSet();
ada.Fill(ds);
DataGrid1.DataSource=ds;
this.DataGrid1.DataBind();
Con.Close();
你这样删不了的,要去掉主外键,或者你sql语句有问题,删的地方不对