积极答复者
求助:GridView添加修改操作

问题
-
求助:GridView添加修改操作
我用的是三层架构,怎么实现添加修改操作呢?
you are welcome- 已更改类型 Cookie Luo 2011年2月23日 12:08
答案
-
你好!
请查看我在下面帖子的回复
知识改变命运,奋斗成就人生!- 已建议为答案 Cookie Luo 2011年2月23日 12:23
- 已标记为答案 Cookie Luo 2011年3月3日 9:29
全部回复
-
1.UI
protected void GridView2_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
this.GridView1.PageIndex = e.RowIndex;
int i = (int)this.GridView1.PageIndex;
BLL.userBLL UB = new userBLL();
if (UB.deleteUserTBLL(i) > 0)
{
Response.Write("删除成功");
}
else {
Response.Write("删除失败");
}
}2.DAL
public int deleteUserTDAL(string sql)
{
con.Open();
SqlCommand cm = new SqlCommand(sql,con);
return (int)cm.ExecuteNonQuery();
}3.BLL
public int deleteUserTBLL(int ID)
{
string sql = "delete from user_tb where userID='" +ID + "' ";
return (int)uDAL.deleteUserDAL(sql);
}删除不了信息,提示:删除失败
错来哪里呢
you are welcome -
你好!
请查看我在下面帖子的回复
知识改变命运,奋斗成就人生!- 已建议为答案 Cookie Luo 2011年2月23日 12:23
- 已标记为答案 Cookie Luo 2011年3月3日 9:29