title: too slow and sorting not work
body: <p>I'm making <code>combobox</code> for sorting option on <code>datagridview</code>.</p>
  
  <pre><code>private DataClasses1DataContext db = new DataClasses1DataContext();
  private int numberOfObjectsPerPage = 20;
  private int CurrentPageIndex = 1;
  private string ordering = "c.name ascending";
  
  private void Form1_Load(object sender, EventArgs e)
  {
      GetData(CurrentPageIndex);            
  }
  
  private void GetData(int page)
  {
      page = page - 1;            
  
      var query = (from c in db.enterprise
      orderby ordering
                      select new { c.id, c.name, c.phone, c.email, c.type, c.city })
                      .Skip(numberOfObjectsPerPage * page).Take(numberOfObjectsPerPage);
  
      dataGridView1.DataSource = query;
  }
  
  private void orderBtn_Click(object sender, EventArgs e)
  {
      if (orderCB.SelectedIndex == 1)
      {
          ordering = "c.name descending";
      }
      else if (orderCB.SelectedIndex == 2)
      {
          ordering = "c.id ascending";
      }
      else if (orderCB.SelectedIndex == 3)
      {
          ordering = "c.id descending";
      }
      else
      {
          ordering = "c.name ascending";
      }
  
      GetData(CurrentPageIndex);            
  }
  </code></pre>
  
  <p>I got two problem in here.</p>
  
  <ol>
  <li>My current data is about <code>2.500</code> row. I'm using pagination so it will display <code>20</code> data/ page, but its still too slow when loading the <code>datagridview</code>. What could be wrong?</li>
  <li>My Ordering button not work.</li>
  </ol>
  
  <p>This is my first time using C#, so maybe I miss something in here :D</p>
  
  <p>Update</p>
  
  <p>So I changed my code as suggestion from the_joric</p>
  
  <pre><code>Func&lt;IEnumerable&lt;cooperations&gt;, IEnumerable&lt;cooperations&gt;&gt; ordering = t =&gt; t;
  </code></pre>
  
  <p>I change DBType to cooperations based on this reference (Hope I'm right :D)
  <img src="https://i.stack.imgur.com/hMIok.png" alt="enter image description here"></p>
  
  <p>But then my datagridview doesn't show anything, what I got is this</p>
  
  <pre><code>System.Linq.Enumerable+&lt;TakeIterator&gt;d__3a`1[&lt;&gt;f__AnonymousType0`7[System.Int32,System.String,System.String,System.String,System.String,System.String,System.String]]
  A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
  </code></pre>