title: No current query in data reader
body: <blockquote>
    <p>System.Exception: No current query in data reader    at
    MySql.Data.MySqlClient.MySqlDataReader.Throw(Exception ex)    at
    MySql.Data.MySqlClient.MySqlDataReader.GetOrdinal(String name)    at
    MySql.Data.MySqlClient.MySqlDataReader.get_Item(String name)    at
    UserData.GetUserData(String
    sessionTicket, String ipAddress, Byte&amp; errorCode)</p>
  </blockquote>
  
  <p>Here is the line it throws an exception on.</p>
  
  <pre><code>userId = Convert.ToInt32(dUserInfo["id"]);
  </code></pre>
  
  <p>Here is the full code.</p>
  
  <pre><code>dbConnection.SetQuery("SELECT users.id,users.username,users.rank,users.motto,users.look,users.gender,users.last_online,users.credits,users.activity_points,users.home_room,users.block_newfriends,users.hide_online,users.hide_inroom,users.vip,users.account_created,users.vip_points,users.machine_id,users.volume,users.chat_preference,users.focus_preference,users.pets_muted,users.bots_muted,users.advertising_report_blocked,users.last_change,users.gotw_points,users.ignore_invites,users.time_muted,users.allow_gifts,users.friend_bar_state,users.disable_forced_effects,users.allow_mimic,users.rank_vip " +
      "FROM users " +
      "JOIN user_auth_tickets " +
      "ON users.id = user_auth_tickets.user_id " +
      "WHERE user_auth_tickets.auth_ticket = @sso AND ip_last = @lastIp " +
      "LIMIT 1"
  );
  
  dbConnection.AppendParameter("sso", sessionTicket);
  dbConnection.AppendParameter("lastIp", ipAddress);
  
  using (var reader = dbConnection.ExecuteReader())
  {
      if (!reader.HasRows)
      {
          errorCode = 1;
          return null;
      }
  
      dUserInfo = reader;
  }
  
  userId = Convert.ToInt32(dUserInfo["id"]);
  </code></pre>