Is this what you are trying to do?
Code:
DataTable dt;
dt = PopulateMyDataTable();
int iStart = 0;
int iEnd = 0;
// Figure out our starting and ending columns
for (int i = 0; i < dt.Columns.Count;i++ )
{
if (dt.Columns[i].ColumnName == "My Start Column")
iStart = i;
if (dt.Columns[i].ColumnName == "My End Column")
iEnd = i;
}
if (iStart > 0 && iEnd > 0 && iStart < iEnd)
{
// Loop through the rows
for (int j = 0; j < dt.Rows.Count; j++)
{
DataRow objRow = dt.Rows[j];
for (int k = iStart; k <= iEnd; k++)
{
// Read Values from here
}
}
}