I'm trying to retrieve user selected data from a database. The user can select up to five fields to show in a report and the fields are a mixture of strings, dates and numbers. I cannot convert the data to strings in the SQL code due to other reports being run. Since I don't know the datatype, I can't do datareader.GetSqlString(column), and since I don't know the name of the column the user may have selected, I can't do datareader.GetString(datareader.GetOrdinal(columnName)). Any ideas on how to retrieve the values from the database without knowing either the datatype or the column name?
Thanks in advance.