Kkula
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.
Our flexible community website is a platform that allows users to connect, share information, and collaborate on various topics of interest. The website offers a range of features such as discussion forums, messaging, user profiles, event calendars, and more. Users can customize their experience by creating and joining different groups or communities based on their interests or location. The website is designed to be user-friendly and adaptable to the needs and preferences of our diverse user base. Whether you are looking to network professionally, share hobbies and interests, or simply connect with like-minded individuals, our flexible community website has something for everyone. Join us today and become a part of our thriving online community!
India
Copyright ©2026
Share this page with your family and friends.