From: Scott M. <bl...@bl...> - 2014-09-05 11:08:45
|
Am I missing a trick here? I'm reading from a BLOB SUB_TYPE 1 column using the following: FbDataReader reader = /* blah */ string text = (string)reader["LONG_TEXT"]; It's okay when there is data, but if the column happens to be NULL I get an error ("Unable to cast object of type 'System.DBNull' to type 'System.String'"), where I'd ideally like to get a plain null. FbDataReader.GetString doesn't work for me as it just returns "" So I'm left with a messy lump of GetOrdinal, IsDBNull, code. There's got to be a better way, but I'm not seeing it. Scott |