Kkula
Browse Questions » Communication / Networks: Odk 1500S-SQL-driver & Mysql bool Information

About User

Questions Asked: 30.3K

Answers Given: 0

0
  • Open
  • New

Communication / Networks: Odk 1500S-SQL-driver & Mysql bool Information

Hello Experts,
we have an IPC with a software controller 1507SF that communicates with a MySQL database via the ODK SQL library.
We have chosen MySQL because, according to the documentation, is the one with the highest number of supported data type.
Everything is going well so far apart from the select of bool type data.
We have set up a very simple SQL test table:
+---------+-----------------+--------+------+----------+----------------------+
| Field    | Type             | Null   | Key | Default | Extra                  |
+---------+-----------------+--------+------+----------+----------------------+
| id         | int unsigned | NO    | PRI | NULL    | auto_increment |
| bool_0 | bit(1)            | YES  |        | b'0'        |                           |
| bool_1 | bit(1)            | YES  |        | b'0'        |                           |
| bool_2 | bit(1)            | YES  |        | b'0'        |                           |
| bool_3 | bit(1)            | YES  |        | b'0'        |                           |
+---------+-----------------+--------+------+----------+----------------------+
We can write data to it without a problem with INSERT or UPDATE instructions but when we try to select any of the bool data we get the following error:
"Index was out of range. Must be non-negative and less than the size of the collection. $R$LParameter name: index"
The strange thing is that it is not a SQL error but seems to be C# related.
The query is 'SELECT bool_0 FROM test_bool WHERE id = ?' and the id is passed as arguments.
We have also made a log of the ODK function using "DebugView++" as indicated in the manual and the same error also appears there (see attached pic.).
It seems that the library misjudge the size of the retrieved data.
Do you there is a way to fix this or we need to use a different data type to store bool values?
Thanks for your support.

0 Likes 0 Favourites 0 Followers 0 Comments
Answers(0)