title: Index was out of range. Must be non-negative and less than the size of the collection Error How to resolve?
body: <p>Hi I am getting this error :</p>
  
  <p><img src="https://i.stack.imgur.com/43MfZ.jpg" alt="enter image description here"></p>
  
  <p>My code is like this, in the <strong>Reservationcontroller</strong>:</p>
  
  <pre><code>private void loadCountry()
      {
          ReservationHelper reservationHelperObject = new ReservationHelper();
  
          ViewData["countryOut"] = new SelectList(reservationHelperObject.LoadCountry());
          ViewData["countryIn"] = new SelectList(reservationHelperObject.LoadCountry());
  
          CountryOut = ((MultiSelectList)(ViewData["CountryOut"])).ToList()[0].Text;
      }
  </code></pre>
  
  <p>Any ideas ?</p>
  
  <p>Continuation of code:</p>
  
  <pre><code>private void loadDefaultvalues()
      {
          List&lt;string&gt; emptyList = new List&lt;string&gt;();
          ViewData["locationIn"] = new SelectList(emptyList);
          ViewData["locationOut"] = new SelectList(emptyList);
          ViewData["RateProgram"] = new SelectList(emptyList);
          ViewData["Currency"] = new SelectList(emptyList);
          ViewData["VehicleClass"] = new SelectList(emptyList);
          ViewData["ReservationStatusDropDownList"] = new SelectList(emptyList);
          ViewData["Miles"] = new SelectList(emptyList);
          ViewData["currencyDropDownList"] = new SelectList(emptyList);
          ViewData["ReservationStatus"] = new SelectList(emptyList);
          ViewData["vehicleClassDropDownList"] = new SelectList(emptyList);
          ViewData["rateProgramDropDownList"] = new SelectList(emptyList);
          ViewData["parentOutDropDownList"] = new SelectList(emptyList);
          ViewData["parentInDropDownList"] = new SelectList(emptyList);
          ViewData["zoneOutDropDownList"] = new SelectList(emptyList);
          ViewData["zoneInDropDownList"] = new SelectList(emptyList);
          ViewData["locationOutDropDownList"] = new SelectList(emptyList);
          ViewData["locationInDropDownList"] = new SelectList(emptyList);
          ViewData["authorizationDropDownList"] = new SelectList(emptyList);
          ViewData["specialServiceDropDownList"] = new SelectList(emptyList);
  
          ViewData["RentalStatus"] = new SelectList(emptyList);
          ViewData["Status"] = new SelectList(emptyList);
          ViewData["Fop"] = new SelectList(emptyList);
          ViewData["CustomerType"] = new SelectList(emptyList);
  
          this.loadRentaStatus();
          this.loadStatus();
          this.loadFop();
          this.loadCustomerTypes();
          this.loadCountry();
          this.loadReservationStatuses();
          //this.loadMilesPercentage()
          this.loadSpecialService();
          this.loadRAType();
          this.loadAirline();
          this.loadTerminal();
          this.loadParentCode();
          this.loadZoneCode();
          this.loadAuthorizationType();
      }
  </code></pre>
  
  <p>Thanks</p>