private void QueryAndCalculate() { try { sqlite.ExecuteUpdate(DeleteTempVarsSQL()); } catch (Exception) { } sqlite.ExecuteUpdate(CreateSqlFunctionSQL()); resultTable = sqlite.ExecuteQuery(CountSumDateTimeOfEachMonthSQL()); }
private bool TruncateTable(string TableName) { if (MessageBox.Show("此操作将永久清空该表,执行后不可恢复!是否继续?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return(false); } if (database.ExecuteUpdate("delete from " + TableName) != 0) { MessageBox.Show("清空数据库" + TableName + "成功", "成功", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(true); } else { MessageBox.Show("数据库" + TableName + "是空的!", "操作失败", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } }