title: How to convert DataTable to object type List in C#
body: <p>I want to convert <code>DataTable</code> to <code>List&lt;object&gt;</code> in C#. Here is my code. But it is not working. Please help me</p>
  
  <pre><code>public List&lt;object&gt; ShowMessage()
  {
      List&lt;object&gt; obj = new List&lt;object&gt;();
  
      DataTable dt = new DataTable();
      dt.Columns.Add("ID");
      dt.Columns.Add("Name");
  
      dt.Rows.Add("1","AAA");
      dt.Rows.Add("2", "BBB");
      dt.Rows.Add("3", "CCC");
  
      foreach (DataRow dr in dt.Rows)
      {
          obj.Add(dr);
      }
  
      return obj;
  }
  </code></pre>
  
  <p><strong>This is the Error--</strong></p>
  
  <p><img src="https://i.stack.imgur.com/GXV2V.jpg" alt="enter image description here"></p>