I am using Pervasive and I would like to know what kind of data a column contains. However, the only overload of PsqlDataReader.GetFieldType accepts an int index. But I want to know using the column name. I guess I could just loop through all the columns and find the one with the specified name, but I do not want to do that.
Is there any way to find the data type of a column by a given column name?
You have to pair the use of GetFieldType with GetOrdinal (which returns the int index of the column):