//This method takes an IDataReader and an IDataFormatter and uses them to convert source rows to standard data rows.
        public static DataTable Convert(IDataReader dataReader, IDataFormatter dataFormatter)
        {
            var sourceDataTable = dataReader.GetDataTable();

            var destDataTable = new StandardDataTable();

            foreach (DataRow row in sourceDataTable.Rows)
            {
                var formattedRow = dataFormatter.FormatRow(destDataTable, row);
                destDataTable.Rows.Add(formattedRow.ItemArray);
            }

            return(destDataTable);
        }