<asp:datagrid runat="server" id="mygrid" OnDeleteCommand="doItemDelete" ...>Sub doItemDelete(ByVal objSource As Object, ByVal objArgs As dataGridCommandEventArgs)
...
End Sub
...
End Sub
解决方案 »
- .net中怎么下载表单
- 有人可以提供webservice的入门资料吗,google的话太乱,找不到合适的,
- 数据绑定方法
- DetailView后台绑定数据时根据判断,使得编辑和新建按钮只能用一个
- 回发或回调参数无效
- "模板页"中的"内容页"如何加载页面标签(高分问题呀!!!)
- 异常处理的思路
- |M| 如何让我的类:public class MyPage: System.Web.UI.Page 在用户控件中可以引用
- 页面启动时执行JS的问题。
- 新手问几个在线聊天并发的问题
- 一道送分的题!!数据库sqlCommand相关的题目
- 对路径“E:\fangnw\WomenIS\doc”的访问被拒绝。请大家帮我看看,解决问题立即揭贴.谢谢.
private void DataGrid1_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
try
{
this.Label1.Text="pppppp";
string delete="DELETE FROM clientinfotb where 消息编号='"+e.Item.Cells[1].Text +"'";
OleDbCommand comm=new OleDbCommand();
comm.CommandText=delete;
comm.Connection=this.oleDbConnection1;
this.oleDbConnection1.Open();
comm.ExecuteNonQuery();
this.oleDbConnection1.Close();
DataSet ds=new DataSet();
this.oleDbDataAdapter1.Fill(ds);
this.DataGrid1.DataSource=ds;
if(this.DataGrid1.Items.Count==1)
{
this.DataGrid1.CurrentPageIndex--;
}
this.DataGrid1.DataSource=ds;
this.DataGrid1.DataBind();
}
catch(Exception error)
{
this.Label1.Text=error.Message;
}
}
然而点击删除按钮,这个事件并没有触发,我还需要做些什么它才能执行?