difference between getting value from DataRow

后端 未结 2 876
名媛妹妹
名媛妹妹 2020-12-03 20:44

Sample code:

    DataTable table = new DataTable();

    // ...
    // insert column to table

    table.Columns.Add(\"name\");

    // ...
    // insert val         


        
2条回答
  •  一整个雨季
    2020-12-03 21:20

    It depends on your purpose but if you look at a definition of both that may tell you;

    DataRow.Item Property (DataColumn) row["name"]

    DataRowExtensions.Field Method (DataRow, DataColumn) row.Field("name")

提交回复
热议问题