Checkbox and SQL Server CE 2.0

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Since there is no boolean datatype I am left wondering how to bind checkbox
state to a field. I have found code to extend a checkbox to a yes/no
function, but not sure where to go from there. I could enter 0 in the
database for false, and 1 for true.

I am trying to make a health tracking program specifically for Type-II
diabetes. The problem is that it has several panels with lots of fields all
linked to different tables. I am trying to keep data updates to a minimum.

I would love to have it update the form on enter and exit, but I am afraid
this will leave way too many opportunities for users to mess things up. It
isn't going to encourage use if people enter all their data for the day and
then lose it due to some mistake.

Can anyone point me to some good resources on form handling with multiple
tables using VB.Net? I was able to find a form stack example that might
apply, except it was in C#, and I am not bi-lingual =)

Thanks for any help.
 
Here's an article on working with multiple forms in VS.Net:
http://msdn.microsoft.com/library/d...ltipleFormsInVisualBasicNETUpgradingToNET.asp

As for the checkboxes, you can handle the databinding yourself
programmatically instead of using .Net automatic databinding. Just set your
checkbox Checked property to true when you have a 1 in the database and
false with 0. (And of course you'd need to handle the updates the same way
but in reverse.

That sounds like a very interesting and useful project by the way!
 
Thank you for your input. I apologize if I was not clear. I was refering to
form handling on the Pocket PC 2003. I posted in the compactframework
newsgroup, but I should have specified platform.

I was referring specifically to the fact that resources are very limited on
PPC and people tend to argue about if and when you should ever close a form,
and how far you should overload a single form (using panels and visibility).

On the subject of checkboxes, I was kind of thinking that. It is a shame
that you can not (in compact framework) simply set the value of the checkbox
to the value of the field. Is me wanting to do this strange? I have looked
everywhere and not found any good examples (or even questions) about this
need.
 
You don't need to manually change the checked state depending on the 1/0
value in the database, as you can add databinding of the checked property to
a numeric type (a bit for example) and then it should work fine.

Steven
 
Back
Top