指定的参数已超出有效值的范围

 

解决方式:

for (int i = 0; i < dataTable.Columns.Count; i++)
{
var k= dataTable.Columns[i].Caption;
}

相关文章: