John Baird
Coatesville, Pennsylvania, United States
Environment versions
Network:
Windows 2008 Server
>>>>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 solution is elegant.
>Please don't start him again, John!
I don't know where that answer came from, since I have no knowledge of programming despite 40 years of it.. lmao..
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only