abouffard/csharp-sqlite

SqliteDataReader.GetBoolean(int i) fails

Closed this issue · 3 comments

SqliteDataReader.GetBoolean(int i) throws an exception.

((object[]) rows[current_row])[i] is string as "0" or "1"
Thus, System.Convert.ToBoolean cannot convert the value.

It should be as:

int result = Convert.ToInt32(((object[])rows[current_row])[i]);
return Convert.ToBoolean(result);

You can pull the corrected version from:
https://code.google.com/r/uygarraf-csharp-sqlite-bugfix/

Original issue reported on code.google.com by uygar.raf@gmail.com on 25 Nov 2012 at 4:01

Original comment by noah.hart@gmail.com on 25 Nov 2012 at 3:00

  • Changed state: Accepted

Original comment by uygar.raf@gmail.com on 25 Nov 2012 at 3:32

  • Changed state: Assigned
#14ba22d62480

Original comment by uygar.raf@gmail.com on 25 Nov 2012 at 3:53

  • Changed state: Fixed