clickclickbang
asked on
Check If Column Exists In An IDataReader Before Calling It
Experts,
Is there any easy way to check if a column exists within an IDataReader before calling it? I'm obviously attempting to avoid the System.IndexOutOfRangeExce ption. I know I can iterate through the GetSchemaTable() to find it but was wondering if there was an easier way.
Thanks much!
~ C
Is there any easy way to check if a column exists within an IDataReader before calling it? I'm obviously attempting to avoid the System.IndexOutOfRangeExce
Thanks much!
~ C
if(reader["columnName"] != null)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the tip!