比如:...{string[]list1={"name1|time1","name2|time2","name3|time3","name4|time4","name5|time5","name6|time6"......}for(inti=0;i
比如:
...{
string[] list1={"name1|time1","name2|time2","name3|time3","name4|time4","name5|time5","name6|time6"......}
for (int i = 0; i < list1.Length; i++)
{
string[] fullurl = list1[i].Split('|');
del(fullurl[0], fullurl[1]);
}
//提示删除成功
}
del方法:
public void del(string FullUrlFileName, string FileLastChangetime)
{
OleDbConnection con = DB.createConnection();
con.Open();
string sql = "delete from Files where Files_name='" + FullUrlFileName.ToString() + "' and
Files_lastchangetime='" + FileLastChangetime.ToString() + "'";
OleDbCommand com = new OleDbCommand(sql, con);
OleDbDataReader dr1;
dr1 = com.ExecuteReader();
dr1.Read();
}
这样实现删除效率我觉得很慢,有没有好方法,一句查询语句删除想删除的对象,不要循环一条一条删除,数组里面的字段对应sql语句where中对应的字段。。
展开