[Mono-dev] NullReference Exception for IDataReader.Get

Mirco Bauer meebey at meebey.net
Sun Jul 22 05:40:23 EDT 2007

On Sat, 2007-07-21 at 10:38 -0300, Rafael Teixeira wrote:
> No, you should call the method that tells if the field is null (
> IsDBNull() see http://msdn2.microsoft.com/en-us/library/system.data.idatarecord.isdbnull(VS.80).aspx),
> and then call GetString() only if it returns false.

or: if (reader[offset + 1] != DBNull) ....


Mirco 'meebey' Bauer

PGP-Key ID: 0xEEF946C8

FOSS Developer    meebey at meebey.net  http://www.meebey.net/
PEAR Developer    meebey at php.net     http://pear.php.net/
Debian Developer  meebey at debian.org  http://www.debian.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: This is a digitally signed message part
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070722/c6d4f579/attachment.bin 

More information about the Mono-devel-list mailing list