How do you set a checkbox depending on a result in SQLite?

165 views Asked by At

I have been trying to get a checkbox to be ticked on a VB.net form in sharpdevelop. The data comes from an SQLite database and is a boolean field. The code i have tried is as followed but doesn't seem to work! I guess it will be very simple but it's been a long day!

If SQLreader("Parent_1_Responsibility") = True Then
        PDV_P1_Parental.Checked = True
        PDV_P1_Parental.CheckState = True
End If

This doesn't seem to work at all! Please help me! :L

Thanks

1

There are 1 answers

0
CL. On BEST ANSWER

SQLite does not have a boolean data type.

If your value is stored as 0/1 in the database, check for that:

If SQLreader("Parent_1_Responsibility") <> 0 Then