I have a datable generated with the contents of a csv file. I use other information to map some csv column (now in datatable) to the information the user needs to fill out.
In a better world, mapping will always be possible. But this is not a reality ... Therefore, before trying to match the value of a data column, I will need to check if this column exists. If I do not do this check, I have an ArgumentException.
Of course, I can verify this with some code:
try { //try to map here. } catch (ArgumentException) { }
but now I have 3 columns to map and some or all may or may not exist
Is there a good way to check if a column exists in a datatable?
c # datatable argumentexception
Rémi Jul 17 '13 at 17:26 2013-07-17 17:26
source share