public void Set <T> (string namespce, string key, T value) { string fq_key = Banshee.Configuration.MemoryConfigurationClient.MakeKey(namespce, key); if (connection.Query <int> (select_id_command, fq_key) > 0) { connection.Execute(update_command, value.ToString(), fq_key); } else { connection.Execute(insert_command, fq_key, value.ToString()); } }
private void iSet(string key, string type, string val) { try { int cnt = _con.Query <int> (_sql_check, key); //int cnt=(int) Convert.ChangeType (rdr[0],typeof(int)); if (cnt == 0) { _con.Execute(_sql_insert, key, type, val); } else { _con.Execute(_sql_update, type, val, key); } } catch (System.Exception ex) { Hyena.Log.Information(ex.ToString()); } }