How do I take a DataTable and convert it to a List?
I\'ve included some code below in both C# and VB.NET, the issue with both of these is that we create a new object
No, creating a list is not costly. Compared to creating the data table and fetching the data from the database, it's very cheap.
You can make it even cheaper by creating the list after populating the table, so that you can set the initial capacity to the number of rows that you will put in it:
IList notes = new List(table.Rows.Count);