C# - как проверить конкретный столбец и его значения
Hi, I have one datatable. it contains 100 columns. the problem is i don't want to check all the columns in the table. I just want to check column from 25 to 50 in sequence. finally i have the score and that i want to compare in that column (25 to 50) values. if any score value is matching then we want to return find the column name. How to do this using data row. below is code for sample. val1 val2 val3 … … val25 val26 … val100 80 100 20 90 20 90 80 40 30 int Score = 80; foreach (DataRow row in result) { // Here i want to check row[25] to row[50] } Output : val26 (if it is matching values then return column name) (val26 is a columnname)
Что я уже пробовал:
foreach (DataRow row in result) { // Here i want to check row[25] to row[50] }
Richard MacCutchan
Просто используйте обычный for
петля столбиков от 25 до 50.