Should I Dispose() DataSet and DataTable?

DataSet and DataTable both implement IDisposable, so, by conventional best practices, I should call their Dispose() methods. However, from what I’ve read so far, DataSet and DataTable don’t actually have any unmanaged resources, so Dispose() doesn’t actually do much. Plus, I can’t just use using(DataSet myDataSet…) because DataSet has a collection of DataTables. So, to … Read more

LINQ query on a DataTable

I’m trying to perform a LINQ query on a DataTable object and bizarrely I am finding that performing such queries on DataTables is not straightforward. For example: var results = from myRow in myDataTable where results.Field(“RowNo”) == 1 select results; This is not allowed. How do I get something like this working? I’m amazed that … Read more