title: Convert DataTable to List<T> where Class of List is Dynamic
body: <p>I am executing a stored procedure from C# code  </p>
  
  <pre><code>private void DataToGrid()
  {
      DataTable dt = new DataTable();
      string[,] aryPara = new string[,] 
      {{ "@pClassId", "10" } ,
      { "@pMediumId", "11" } ,
      { "@pStreamId", "12" } ,
      { "@pSessionId","13" } ,
      { "@pSectionId", "15" } ,
      { "@pShiftId", "16" } ,
      { "@pDateId", "17" } };
  
      dt = CallStoredProcedureUsingAdapterFillDataTabel("ssspAtdDailyattendance", aryPara);  
      DatagridView1.DataSource = dt;
  }
  
  public DataTable CallStoredProcedureUsingAdapterFillDataTabel(string StoredProcedureName, [Optional] string[,] aryParameters)
  {
      SqlConnection con = new SqlConnection();
      con.ConnectionString = "Data Source=AIS-OCTACORE\SQLserver2008r2;Initial Catalog= SchoolSoulDataTest; integrated security=SSPI";
      con.open();
      SqlCommand lSQLCmd = new SqlCommand();
      SqlDataAdapter adp = new SqlDataAdapter();
      DataTable dt = new DataTable();
      lSQLCmd.CommandType = CommandType.StoredProcedure;
      lSQLCmd.CommandText = StoredProcedureName;
      lSQLCmd.CommandTimeout = 300;
      try
      {
          for (int i = 0; i &lt; aryParameters.GetLength(0); i++)
          {
              lSQLCmd.Parameters.Add(new SqlParameter(aryParameters[i, 0], aryParameters[i, 1]));
          }
      }
      catch (Exception ex)
      {
  
      }
      lSQLCmd.Connection = con;
      adp.SelectCommand = lSQLCmd;
      adp.Fill(dt);
      clsConnectionClose();
      return dt;
  }
  </code></pre>
  
  <p>Where <code>ssspAtdDailyattendance</code> is a Dynamic Stored Procedure in which data returned by the stored procedure has variable number of columns.</p>
  
  <p>Now I want to convert DataTable <code>dt</code> to a <code>List&lt;T&gt;</code> but as <code>dt</code> return variable number of columns thus type of T is not Fixed</p>
  
  <p>So my question is how could I convert <code>dt</code> to <code>List</code>?</p>