title: Populate an asp.net Gridview dynamically with List<T>
body: <p>I have a list of Employee records being returned in a List format. How can I populate a gridview dynamically?  </p>
  
  <pre><code>ePremiumSubscriber.Subscriber PremSubData = new ePremiumSubscriber.Subscriber();
  List&lt;ePremiumSubscriber.Subscriber&gt; premSubList = new List&lt;ePremiumSubscriber.Subscriber&gt;();
  
  ePremiumCustomerDAL.SearchPremSubscriberData(premSubList, sqlQuery);  
  
  
  DataTable dtSearchResults = new DataTable();
  dtSearchResults.Columns.Add("psLastName", System.Type.GetType("System.String"));
  dtSearchResults.Columns.Add("psFirstName", System.Type.GetType("System.String"));
  </code></pre>