As you know, a populated
DataSet
is made up of one or more
DataTables
. Each
DataTable
contains a
Columns
collection which contains the list of columns in that
DataSet
. All you need to do is:
bool isNamePresent = ds.Tables[0].Columns.Contains("NameField");