title: Data source is an invalid type. It must be either an IListSource, IEnumerable, or IDataSource
body: <p>Data source is an invalid type. It must be either an IListSource, IEnumerable, or IDataSource. The error is displayed when I bind the grid view </p>
  
  <pre><code>var list = dal.GetEmployeebyName(name);
  GridViewEmployee.DataSource = list;
  GridViewEmployee.DataBind();
  </code></pre>
  
  <p>i have the query</p>
  
  <pre><code>public EmployeeInfo GetEmployeebyName(String name)
  {
      using (var context = new HRMSEntities())
      {
          return context.EmployeeInfo.FirstOrDefault(e =&gt; e.FName == name);
      }
  }
  </code></pre>