I try to use
currentOrder.PONumber = (reader.IsDBNull("PONumber") ? "Geen klantreferentie" : reader.GetString("PONumber"));
and I have the following errors:
The best overloaded method match for 'System.Data.Common.DbDataReader.IsDBNull(int)' has some invalid arguments.
and
Argument 1: cannot convert from 'string' to 'int'.
When I use the columnindex in IsDBNull
, I have the following error:
Data is Null. This method or property cannot be called on Null values.
How can I solve this?