access 数据库数据删除 在access 数据库数据删除时,我想在执行完删除语句后返回一条结果来告诉我有没有删除成功,这个应该怎么做!第一次使用access配合ASP.NET开发项目,不懂 呵呵!希望大家帮帮忙!谢谢。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 [color=#FF0000]protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e){ string text = "Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source="; OleDbConnection connection = new OleDbConnection(text + base.get_Server().MapPath(@"..\App_Data\Aqbiopharma.mdb")); string text2 = "delete from Product where ProductID=@ProductID"; OleDbCommand command = new OleDbCommand(text2, connection); command.get_Parameters().AddWithValue("@ProductID", this.GridView1.get_DataKeys().get_Item(e.get_RowIndex()).get_Value()); try { connection.Open(); if (command.ExecuteNonQuery() > 0) { this.get_Page().get_ClientScript().RegisterStartupScript(base.GetType(), "", "<script>alert('删除成功')</script>"); } } catch (Exception) { } finally { connection.Close(); } this.BindComments();} MVC 传参 网站用户登录如何做 请问如何将一个表中的数据循环插入5000次啊? 关于JMAIL乱码的问题 请教SESSION问题 IHttpModule问题 请问一下半角数字校验的问题??? 我用邹键的分页储存过程,当表有主键或自动增长字段时翻页时出错,请解解决办法 设置断点调试的时候提示:当前不会命中断点。还没有为该文档加载任何符号。是怎么回事?该怎么解决?谢谢!! Dropdownlist控件SelectedIndexChanged事件的触发 sql 中 set nocount on 深层作用? 寻求一常见MSSQL存储过程,现在卡住了,不知如何写好,效率要高点!
{
string text = "Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source=";
OleDbConnection connection = new OleDbConnection(text + base.get_Server().MapPath(@"..\App_Data\Aqbiopharma.mdb"));
string text2 = "delete from Product where ProductID=@ProductID";
OleDbCommand command = new OleDbCommand(text2, connection);
command.get_Parameters().AddWithValue("@ProductID", this.GridView1.get_DataKeys().get_Item(e.get_RowIndex()).get_Value());
try
{
connection.Open();
if (command.ExecuteNonQuery() > 0)
{
this.get_Page().get_ClientScript().RegisterStartupScript(base.GetType(), "", "<script>alert('删除成功')</script>");
}
}
catch (Exception)
{
}
finally
{
connection.Close();
}
this.BindComments();
}