public static void CreateTable(SQLiteConnection connection) { using (SQLiteCommand command = connection.CreateCommand()) { DBTableCommands.CreateTable(command); command.ExecuteNonQuery(); } }
public static void UpdateRow(SQLiteConnection connection, TableModel model) { using (SQLiteCommand command = connection.CreateCommand()) { DBTableCommands.UpdateRow(command, model); long check = command.ExecuteNonQuery(); DBPoint3D.UpdateRow(model.position, connection); DBMatrix3d.Update(connection, model.matrixTransform); } }
public static long InsertRow(SQLiteConnection connection, TableModel model) { using (SQLiteCommand command = connection.CreateCommand()) { DBTableCommands.InsertRow(command, model); long check = command.ExecuteNonQuery(); if (check == 1) { model.ID = connection.LastInsertRowId; return(model.ID); } else if (check == 0) { throw new Exception("DBTable -> InsertRow -> Can't insert."); } throw new Exception("DBTable -> InsertRow -> Failed to Insert."); } }