private void CloseDB_ERR() { try { SQLiteController.CloseController(); SQLiteController = null; return; } catch (Exception err) { _ = MessageBox.Show(err.Message); return; } }
private bool CloseDB() { if (SQLiteController == null) { return(true); } try { bool _ = SQLiteController.CloseController(); SQLiteController = null; return(_); } catch (Exception err) { _ = MessageBox.Show(err.Message); return(false); } }
private void InitDB() { try { SQLiteController = new LilacSQLiteController(DBNameString); if ((SQLiteController == null) || !SQLiteController.IfConnectionSuccess()) { CloseDB_ERR(); SQLiteController = null; StackTrace trace = new StackTrace(1, true); StackFrame frame = trace.GetFrame(0); throw new Exception("LilacSQLiteController初始化失败!\r\n" + frame.GetFileName().ToString() + "\r\n" + frame.GetFileLineNumber().ToString() + "\r\n" + frame.GetMethod()); } } catch (Exception err) { _ = MessageBox.Show(err.Message); return; } }