private void dtgListGuestBook_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
string sql = "delete * from GuestBook where ProductId = ?";
string connString = Bll.GetConn();
AdoHelper helper = AdoHelper.CreateHelper("WebDataBase");
string ProductId = e.Item.Cells[0].Text;
IDataParameter[] param = {helper.GetParameter("@ProductId",ProductId)};
helper.ExecuteNonQuery(connString,CommandType.Text,sql,param); BindGrid();
}出现错误:至少一个参数没有被指定值。 这样写有什么不对吗?
{
string sql = "delete * from GuestBook where ProductId = ?";
string connString = Bll.GetConn();
AdoHelper helper = AdoHelper.CreateHelper("WebDataBase");
string ProductId = e.Item.Cells[0].Text;
IDataParameter[] param = {helper.GetParameter("@ProductId",ProductId)};
helper.ExecuteNonQuery(connString,CommandType.Text,sql,param); BindGrid();
}出现错误:至少一个参数没有被指定值。 这样写有什么不对吗?
解决方案 »
- 求救各位 怎么样把SQLSERVER数据库的整型数据转化成c#中的二维数组,谢谢!
- 一个小调查
- C#中怎样用代码创建数据表
- DateGrid读库两个写段分别在两个表怎么读
- 昨天我问的弹出窗口问题的,后续问题!弹出窗口后,页面原来的控件属性失效!
- asp.net关于Fill: SelectCommand.Connection 属性尚未初始化的错误
- 请问怎样做?
- 自己的机子做服务器
- 关于accordion的xmldatasource的问题
- 无效的 CurrentPageIndex 值。它必须大于等于 0 且小于 PageCount。 这个问题让我烦死了
- 明明装了sql server2000了 为什么还提示没装SQL SERVER2000或MSDE啊?
- 关于在用户控件中执行button事件的问题
我真是摆乌龙!!!
GuestBook的表里怎么会有ProductId呢?谁顶一下,我好结帖。