DAL层中根据ID删除方法(常用)

重点还是我们底层的SqlHelper写好哦,

1.还是同样的把我们的sql语句先写出来~

string sql = "delete from ProInfo where proID=" + id;

我们的sql语句可以在mysql内反复测试,在进行写入。

2.带入使用

public static int Delete(int id)
        {
            string sql = "delete from ProInfo where proID=" + id;
            return SqlHelper.Zsg(sql);
        }
return SqlHelper内增删改的方法返回值为int类型。

原文地址:https://www.cnblogs.com/NeatFan/p/13175867.html