根据条件实现datalist中信息的删除功能啊??
string str="select count(*) as count,users.dep_id,dep.dep_name from users,dep where users.dep_id=dep.dep_id group by users.dep_id,dep.dep_name";dr=com.ExecuteReader();
while(dr.Read())
{
int Count=Convert.toInt32(dr["count"]);
if(Count==0)
{string str1="delete * from dep where "}
}
我想实现的功能:
当部门aa中有员工时,不允许删除;若没有员工,则允许删除