is possible have kind of type converter allows sync framework treat string "0"/"1" boolean values false/true. per bool.parse documentation not supported default there way around it?
more details in case can suggest different approach issue: have custom sync framework client implementation android , uses sqlite database there no way me enforce strict datatype on table field. come convention indicate boolean field with, say, "is" prefix, nasty. thing booleans in sqlite treated numeric type inserting/updating boolean false/true sqlite database automatically converts them 0/1 , not want introduce true/false = 1/0 conversion on android side.
any thoughts welcome.
[update] more details: server side consists of services using microsoft sync framework 4.0 ctp. there isn't lot configure except creating scope , on. client side generates changeset , transmits server using json format. changeset comes sqlite database (and sqlite doesn't have native boolean representation except numeric 0/1), when reading database there no indication coming data of boolean type. field value serialized json object string numeric value ("0" or "1") , server side fails while trying parse bool.
btw possible work around if doing one-way client-to-server synchronisation. manually set server side entity field type byte , sync framework nicely uses "bit" database type. workaround doesn't work server-to-client tho'.
the usual way in c#/.net use convert.toboolean()
Comments
Post a Comment