Commit 09fa31df authored by tr's avatar tr

1、清空表,日志优化

parent dbf01564
......@@ -91,7 +91,7 @@ namespace Tools.UI
{
//外键表,需要删除数据,然后重置自增主键
var foreign_sql = $@"
DELETE FROM { table}
DELETE FROM {table}
DBCC CHECKIDENT('{table}',RESEED,0)";
this._db.ExecNonSql(foreign_sql);
this.EmptyLog.Add(foreign_sql.Trim());
......@@ -99,7 +99,8 @@ namespace Tools.UI
}
}
//记录日志
string path = $@"{Utils.TempPath}\EmptyTable_{DateTime.Now.ToString("yyyyMMddHHmmss")}.txt";
this.EmptyLog.Insert(0, $@"--数据库:{this.tslbLinkString.Text}");
string path = $@"{Utils.TempPath}\{this.tstbMainTable.Text}_{DateTime.Now.ToString("yyyyMMddHHmmss")}.txt";
File.WriteAllText(path, string.Join("\r\n", this.EmptyLog));
//完成提示
Utils.Tip($"已清空{this.tstbMainTable.Text}的关联表!");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment