I created a list from an excel document that has partnumbers on the every other starting with the first, and prices on every other row, starting with the second.
Lets say I initialize a datatable like so..
DataTable priceListTable = new DataTable(); priceListTable.Columns.Add("ItemNumber", typeof(string)); priceListTable.Columns.Add("Price", typeof(Float)); And my list (called recordList) looks this;
001-001 1.45 001-002 3.49 How do I get the first two rows of the list to fill the columns of the dataTable?