[Mono-list] Exception thrown by IDataReader.Get

Adrien Dessemond adrien.dessemond at softhome.net
Thu Jul 19 07:16:13 EDT 2007


On Thu, 2007-19-07 at 11:06 +0530, ~ * ~ Srijith Unni ~ * ~ wrote:

Hello Srijith,

> The stack trace seen is ,
> 
>    Unhandled Exception: System.NullReferenceException: Object
> reference not set to an instance of an object
>             at Mono.Data.SqliteClient.SqliteDataReader.GetString
> (Int32 i) [0x00000]

You must always test against IsDBNull() when you use nullable fields :

if(yourDataReader.IsDBNull(offset+1)) { .....


Kind regards,

Adrien




More information about the Mono-list mailing list