コード例 #1
0
        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) { }
            }
        }
コード例 #2
0
 public InsertCommand(Insertable <string> client, string value)
 {
     _client = client;
     _value  = value;
 }
コード例 #3
0
 public InsertHandler(Invoker invoker, Shortcut shortcut, Insertable <string> client, string value) : base(invoker, shortcut)
 {
     _client = client;
     _value  = value;
 }