I got this:
var dsetValueFields = rds.Result.Columns.Cast<DataColumn>().Where(c=>c.DataType==typeof(Decimal));
And need to convert into a DataTable. Tried this:
DataTable dt = new DataTable();
dt.Columns.AddRange(dsetValueFields.ToArray());
But get error, “Column is part of another table.”
Thanks!
You’ll need to create copies of the columns in your enumerable. Like
DataRows,DataColumns can only be attached to one table.