Hi All,

        I am using Mono to read from a sqlite database, using IDataReader
        I am getting a NullReference Exception when I have read a
particular row and when i call reader.GetString method to retrieve a field.
This happens only when the specific field in the row is empty. I was under
the impression that if the field is empty , the method should return either
null or an empty string. Don`t know why it is raising an Exception.

   My code is like this,
          IDbCommand cmd = Connection.CreateCommand ();
           cmd.CommandText = query;

           try {
               IDataReader reader = cmd.ExecuteReader ();
               while (reader.Read ()) {
                      key = reader.GetString(offset + 1);
               ...
                      }

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]


  Am I doing something wrong or has this been rectified in a later version.
I am using Mono 1.2.2 ( posting to this list, because it feels like a bug! )

 Any help or comments, would be greatly appreciated.

--
Thanks & Regards,
--
A.Srijith.K.Unni

Mail ID : [EMAIL PROTECTED] <//[EMAIL PROTECTED]/>
Home Page : http://srijith.unni.googlepages.com/
_______________________________________________
Mono-devel-list mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to