在DataGrid中更新不可数据库,请教
在ASP.NET中,GataGrid中有一个删除按纽列,点击该删除按纽,可以在GataGrid中删除一行,但没有更新到数据库,不知道哪里出现了问题,请教各位高手,部分代码如下:
//绑定DataSet到DataGrid1
DataGrid1.DataSource = ds;
DataGrid1.DataBind();
DataView dv ;
dv = new DataView( ds.Tables["notice"]);
dv.RowFilter = "id= " +e.Item.Cells[0].Text.Trim();
if (dv.Count > 0)
{
dv.Delete(0);
}
if (ds.HasChanges())
{
oleDbDataAdapter1.Update(ds,"notice"); //该句也能执行到,就是更新不了数据库
}