title: Using Lambda expressions to query DataTable filled by SQL statement
body: <p>I am building a WinForm that displays the number of appointments for each customer in a DataGridView. I can do this with a basic SELECT statement, but the requirements call for at least 2 Lambda Expressions. I have created 1 Lambda expression, but so far it doesn't do anything. From what I understand, a Lambda can be used to query a DataTable similar to how a SQL statement queries a table. But for some reason, nothing happens. The DataTable fills fine, but the Lambda doesn't do anything.</p>
  
  <p>Here is the entirety of the code for the WinForm:</p>
  
  <pre><code>using System;
  using System.Collections;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  using MySql.Data.MySqlClient;
  using System.Data.Entity;
  using System.Data.Linq;
  
  
  namespace C969_Software_2
  {
  public struct Customer
  {
      public string customerName;
      public int numberOfApps;
  }
  
  public partial class CustomerReports : Form
  {
      public CustomerReports()
      {
          InitializeComponent();
          customerReportView.DataSource = getReport();
      }
  
  
      public static DataTable getReport()
      {
          string SqlString = "SELECT * FROM customer";
          MySqlConnection c = new MySqlConnection(SqlUpdater.conString);
          MySqlDataAdapter sda = new MySqlDataAdapter(SqlString, c);
          DataTable dt = new DataTable();
  
          c.Open();
          sda.Fill(dt);
          dt.AsEnumerable()
              .Where(i =&gt; i.Field&lt;int&gt;("customerId") == 1)
              .Select(i =&gt; new { name = i.Field&lt;string&gt;("customerName")});
  
       return dt;
      }
  }
  }
  </code></pre>
  
  <p>Any pointers would be appreciated!</p>