How to check whether the datatable contains one column header "Name"

How to check whether a datatable contains one column Header as “Name” using Datatable methods( example dt.select)


first line just visualize the ColumnCollection and we do see that Name is a present ColumnName
second line show cases on how to check if a column exists under a particular name

Assign this to a Boolean:

DataRow.Table.Columns.Contains("Name")
1 Like