for (int i = 0; i < this.rptNews.Items.Count; i++)
{
CheckBox cbx = (CheckBox)rptNews.Items[i].FindControl("cbx");
Label lbl = (Label)rptNews.Items[i].FindControl("lbl");
if (cbx != null)
{
if (cbx.Checked)
{
delId += lbl.Text + ",";
}
}
}//去掉最后一个
delId = (delId + ")").Replace(",)", "");
Response.Write("删除的语句是:delete from edit where edit_id= in(" + delId + ")");
OleDbConnection conn = new OleDbConnection(ConfigurationManager.ConnectionStrings["play"].ToString());
conn.Open();
string sql = "delete from edit where edit_id= in(" + delId + ")";
OleDbCommand ocm = new OleDbCommand(sql, conn);
ocm.ExecuteNonQuery();
conn.Close();
bind();
}在ocm.ExecuteNonQuery();中指出错误
{
CheckBox cbx = (CheckBox)rptNews.Items[i].FindControl("cbx");
Label lbl = (Label)rptNews.Items[i].FindControl("lbl");
if (cbx != null)
{
if (cbx.Checked)
{
delId += lbl.Text + ",";
}
}
}//去掉最后一个
delId = (delId + ")").Replace(",)", "");
Response.Write("删除的语句是:delete from edit where edit_id= in(" + delId + ")");
OleDbConnection conn = new OleDbConnection(ConfigurationManager.ConnectionStrings["play"].ToString());
conn.Open();
string sql = "delete from edit where edit_id= in(" + delId + ")";
OleDbCommand ocm = new OleDbCommand(sql, conn);
ocm.ExecuteNonQuery();
conn.Close();
bind();
}在ocm.ExecuteNonQuery();中指出错误
解决方案 »
- 怎么点确定后返回页面呢
- 给个ASP.NET 4.0的treeview控件下载地址
- .net服务器控件添加一个按钮后,如何设置其类型
- IFrame中页面 按钮事件后 页面样式失效问题
- 求关于treeview 的javascript
- 怎样才能在网页中横向显示表中的一列数据?望高人指点!!
- 高分求解:c#如何在WEBFROM中调用WORD2000文档,并且嵌入到html里面,并且在WORD内编辑文档。
- 请问如何在页面的.CS文件中访问.aspx中由javascript生成的文本表单
- 一个错误
- 第一次听到这个消息你们都怎么想?
- 正则 在a标签中 获取 特定类型的url 求救
- js打印问题。本人用document.all.WebBrowser.ExecWB(6,1)打印出了问题。请高手指教。在线等。。
-- 这种写法有语法错误,要不改为:(edit_id=1 or edit_id=2)
-- 要不改为edit_id in (1,2)
改为
delete from edit where edit_id in(" + delId + ")";