public void insertIntoTable(Insertable element, String tableName) { MySqlConnection con = GetMySqlConnection(); try { string sql = "INSERT INTO " + tableName + " ( " + element.getOrderedFields() + " )" + " VALUES ( " + element.getOrderedValues() + " ) "; con.Open(); using (MySqlCommand cm = new MySqlCommand(sql, con)) { cm.ExecuteNonQuery(); } } catch (Exception e) { Console.WriteLine(e.Message.ToString()); } finally { try { con.Close(); } catch (Exception e) { } } }
public InsertCommand(Insertable <string> client, string value) { _client = client; _value = value; }
public InsertHandler(Invoker invoker, Shortcut shortcut, Insertable <string> client, string value) : base(invoker, shortcut) { _client = client; _value = value; }