Use Row.ItemArray to Check Column Name before accessing

How might I use DataTable  Row   ".ItemArray" property to check a column name before I attempt

x = MyRow.Item(myColumnNameVariable)

Purpose:  I want to make sure I haven't misspelled the column name when I pass it to this statement using varColumnNameVariable.

Any guidance on this would be appreciated.

Thanks!


LVL 2
codequestAsked:
Who is Participating?
 
satish_nagdevConnect With a Mentor Commented:
hi,
sorry your question is not clear to me but i think you want to get column name from datatable,
you can use dataset.Table[0].Columns[0].ColumnName.

regards,
satish.
0
 
codequestAuthor Commented:
Thanks for input.  That looks right (I was just guessing about ItemArray).   I'll try it and post results.
0
 
codequestAuthor Commented:
Still waiting to get back to this one...
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
codequestAuthor Commented:
STILL working my way back to this one...
0
 
codequestAuthor Commented:
StILL working my way back to this one...
0
 
satish_nagdevCommented:
let me know when u get back to this :-)

regards,
satish.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.