Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does dataset have a column?
Message
From
18/07/2014 00:31:15
 
 
To
17/07/2014 22:56:41
John Baird
Coatesville, Pennsylvania, United States
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01603979
Message ID:
01603997
Views:
48
>>>>>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..

I admire your ongoing contributions to the community. If I ever sell a copy of my software for $15M I'm not sure how much I'd still hang around here.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform