示例#1
0
 private static string getUserValueByIdAndAttr(int idUser, string attrName)
 {
     db = new DBHelper();
     int attrId = db.GetAttrIdByName(attrName);
     openConnection();
     string condition = "id_user = '******' and id_attr = '" + attrId.ToString() + "'";
     MySqlCommand command = new MySqlCommand(db.SelectSQLQuery("value", Const.USER_VALUES_TABLE, condition), connection);
     MySqlDataReader reader = command.ExecuteReader();
     if (reader.Read() == false) {
         return "";
     }
     string userValue = reader.GetString(0);
     connection.Close();
     return userValue;
 }