club_config字段:
bbsname,topicname
reback_config字段:
topicname,topic
现在要根据club_config的a字段删除reback_config里面的记录
我写的句子,但是调试了半天始终不能把表二里面的记录删除掉,
请教高手,不胜感激。String deleteCmd2 = "delete from reback_config where topicname in (select topicname from club_config where bbsname=@bbsname)";
SqlConnection myConnection2 = new SqlConnection(ConfigurationSettings.AppSettings["myweb"]);
SqlCommand myCommand2 = new SqlCommand(deleteCmd2, myConnection2);
myCommand2.Parameters.Add(new SqlParameter("@bbsname", SqlDbType.VarChar, 50));
myCommand2.Parameters["@bbsname"].Value =MyDataGrid.DataKeys[(int)E.Item.ItemIndex].ToString();
bbsname,topicname
reback_config字段:
topicname,topic
现在要根据club_config的a字段删除reback_config里面的记录
我写的句子,但是调试了半天始终不能把表二里面的记录删除掉,
请教高手,不胜感激。String deleteCmd2 = "delete from reback_config where topicname in (select topicname from club_config where bbsname=@bbsname)";
SqlConnection myConnection2 = new SqlConnection(ConfigurationSettings.AppSettings["myweb"]);
SqlCommand myCommand2 = new SqlCommand(deleteCmd2, myConnection2);
myCommand2.Parameters.Add(new SqlParameter("@bbsname", SqlDbType.VarChar, 50));
myCommand2.Parameters["@bbsname"].Value =MyDataGrid.DataKeys[(int)E.Item.ItemIndex].ToString();
"delete from reback_config where topicname in (select topicname from club_config where bbsname='" + @bbsname + "')"
程序可以直接写的,因为它是参数。