62,046
社区成员
发帖
与我相关
我的任务
分享
//删除数据
public int DelAdmin(int sId)
{
OleDbConnection myconn = new OleDbConnection(DB.conn);
OleDbCommand mycmd = new OleDbCommand("delete from baoming where [id] ="+sId, myconn);
int nResult = -1;
try
{
myconn.Open();
nResult = mycmd.ExecuteNonQuery();
}
catch (OleDbException ex)
{
throw new Exception(ex.Message, ex);
}
finally
{
myconn.Close();
}
return nResult;
}