title: Unable to access items of an IQueryable<T> by index
body: <p>I'm new to c#. I'm attempting to use what ought be a list(?) produced by a linq query to build a table on an ordering form.  Part of that involves referencing a specific item in that list as below:</p>
  
  <pre><code>using (CellOrderingDBEntities db = new CellOrderingDBEntities())
  {
      var AccessoryItems = from AccessoryDescription in db.Accessories
                           join HardwareID in db.HardwareTypes
                               on AccessoryDescription.HardwareType equals HardwareID.HardwareID
                           where AccessoryDescription.DateRetired == null
                           select AccessoryDescription;
  
      List&lt;Device&gt; DevicesList = (List&lt;Device&gt;)Session["DevicesList"];
  
      Guid AccessoriesOrder = (from ServiceID in db.TypeOfServices
                                  where ServiceID.ServiceType == "Accessories Order"
                                  select ServiceID.ServiceID).FirstOrDefault();
  
      //This Int is used to build the accessories table
      int AccessoryRows = AccessoryItems.Count();
  
      if (SType == AccessoriesOrder)
      {
          for (int r = 0; r &lt;= AccessoryRows; r++)
          {
              TableRow row = new TableRow();
              for (int c = 0; c &lt; 3; c++)
              {
                  TableCell cell = new TableCell();
                  TextBox tb = new TextBox();
                  int ai = 0;
                  int ri = 0;
  
                  tb.ID = "TextBoxRow_" + r + "Col_" + c;
                  if (c == 0)
                  {
                      cell.Controls.Add(tb);
                  }
                  else if (c == 1)
                  {
                      cell.Text = AccessoryItems[ai];
                      ai++;
                  }
              }
          }
      }
  </code></pre>
  
  <p>I'm stuck with this error though:</p>
  
  <pre>
  Cannot apply indexing with [] to an expression of type 'System.Linq.IQueryable&lt;Data.Accessory&gt;'
  </pre>
  
  <p>I've tried converting it to a list of strings but for reasons I do not understand why it won't let me access the <code>IQueryable</code> by index.  </p>