DataRow: Select cell value by a given column name

后端 未结 8 1542
小鲜肉
小鲜肉 2020-12-15 15:19

I have a problem with a DataRow that I\'m really struggling with.

The datarow is read in from an Excel spreadsheet using an OleDbConnection.

If I try to sele

8条回答
  •  感动是毒
    2020-12-15 15:31

    I find it easier to access it by doing the following:

            for (int i = 0; i < Table.Rows.Count-1; i++) //Looping through rows
            {
                var myValue = Table.Rows[i]["MyFieldName"]; //Getting my field value
    
            }
    

提交回复
热议问题