>>>Hi,
>>>
>>>What is the fastest (or an efficient) method to find out if a dataset (not strongly typed) has a column; by name. For example; I have a dataset MyDataSet (created by loading an XML file) and I want to find out if the dataset has column MyColumn.
>>>
>>>TIA
>>
>>I think that you might want to look at the datatable, rather than the dataset.
>>The datatable has a columns collection that contains the names of the columns in the table.
>>You can search the collection or loop through it looking for the column you have in mind.
>
>MyDataSet.MyDataTable.Columns("my column") != null
>
>But hopefully, they're not typed data sets... LOL
Your suggestion is very close to the solution to my question.
if (MyDataSet.Tables[0].Columns["MyColumn"] != null)
{
}
Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham