ADO.NET DataRow - check for column existence

前端 未结 2 1376
借酒劲吻你
借酒劲吻你 2020-12-13 08:19

How do I check for the existence of a column in a datarow?

I\'m building datatables to organize some data that I\'ve already pulled back from the database. Dependin

相关标签:
2条回答
  • 2020-12-13 08:59

    You can simply check like this:

    return row.Table.Columns.Contains(columnName);
    
    0 讨论(0)
  • 2020-12-13 09:01

    DataTables have that schema info, so check if the Row's Table's Columns collection contains the field.

    0 讨论(0)
提交回复
热议问题