GameFramework.DataDML.LoadSingleTableGlobalData C# (CSharp) Method

LoadSingleTableGlobalData() private static method

private static LoadSingleTableGlobalData ( List primaryKeys ) : GeneralRecordData
primaryKeys List
return GameFrameworkData.GeneralRecordData
        private static GeneralRecordData LoadSingleTableGlobalData(List<string> primaryKeys)
        {
            GeneralRecordData ret = null;
            try {
              using (MySqlCommand cmd = new MySqlCommand()) {
                cmd.Connection = DBConn.MySqlConn;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "LoadSingleTableGlobalData";
                if(primaryKeys.Count != 1)
                    throw new Exception("primary key number don't match !!!");
                MySqlParameter inputParam;
                inputParam = new MySqlParameter("@_Key", MySqlDbType.VarChar);
                inputParam.Direction = ParameterDirection.Input;
                inputParam.Value = primaryKeys[0];
                inputParam.Size = 32;
                cmd.Parameters.Add(inputParam);
                using (DbDataReader reader = cmd.ExecuteReader()) {
                  if (reader.Read()) {
                    ret = new GeneralRecordData();
                    object val;
                    TableGlobalData msg = new TableGlobalData();
                    val = reader["Key"];
                    msg.Key = (string)val;
                    ret.PrimaryKeys.Add(val.ToString());
                    val = reader["IntValue"];
                    msg.IntValue = (int)val;
                    val = reader["FloatValue"];
                    msg.FloatValue = (float)val;
                    val = reader["StrValue"];
                    msg.StrValue = (string)val;
                    ret.DataVersion = (int)reader["DataVersion"];
                    ret.Data = DbDataSerializer.Encode(msg);
                  }
                }
              }
            } catch (Exception ex) {
              DBConn.Close();
              throw ex;
            }
            return ret;
        }