62,046
社区成员
发帖
与我相关
我的任务
分享
public static bool DeleteAuth(string strID, string strRoom)
{
try{
string strConn = System.Configuration.ConfigurationManager.ConnectionStrings["ECSORUSP"].ConnectionString;
Hashtable parameters = new Hashtable();
string sSQL = "delete from dbo.Web_CardPurview where id=@id and room=@room";
parameters.Clear();
parameters.Add("@id", strID);
parameters.Add("@room", strroom);
MSDataAccessTool.DataAccessMSSQL.ExecuteSQL(strConn, sSQL);
return true;
}
catch
{
return fales;
}
}
[/quote]
那你直接
string sql="delete dbo.Web_CardPurview where id=101 and room='A101';delete dbo.Web_CardPurview where id=102 and room='A102'"
反正也是批处理的。
至于这个sql肯定是for拼接出来的public static bool DeleteAuth(string strID, string strRoom)
根本就该扔掉。如果高层一点的东西自己不会设计,建议请求你的领导重新进行程序设计知识培训。你贴的代码与出问题的设计根本不是一个层次的代码(根本不是在这个层面去修改代码),这已经说明了更深的问题。
public static bool DeleteAuth(string strID, string strRoom)
{
try{
string strConn = System.Configuration.ConfigurationManager.ConnectionStrings["ECSORUSP"].ConnectionString;
Hashtable parameters = new Hashtable();
string sSQL = "delete from dbo.Web_CardPurview where id=@id and room=@room";
parameters.Clear();
parameters.Add("@id", strID);
parameters.Add("@room", strroom);
MSDataAccessTool.DataAccessMSSQL.ExecuteSQL(strConn, sSQL);
return true;
}
catch
{
return fales;
}
}