Did you actually follow the procedure that is described in the article? As the article explains, CopyToDataTable
by default only works on an IEnumerable<DataRow>
. If you want to use the method on a custom type you need to Implement CopyToDataTable Where the Generic Type T Is Not a DataRow
All of the examples in that section assume you have followed the process and created the custom CopyToDataTable<T>
method first.