MikeR
Joined: 25 Jun 2016 Posts: 29
|
Posted: Wed Jan 17, 2018 9:39 pm Post subject: More Fun With PostgreSQL and VDO |
|
|
The ODBC driver that is pulled with the PostgreSQL installer defaults to an option, "Bools as Char". If this option is selected, it breaks the use of the GetBoolValue() method of VDO. Instead, you'll need to do this [C#]:
get
{
string s = GetStringValue("your_property_name", true);
bool b = false;
if (s != null && s.Length > 0) b = s == "1" || s.ToUpper()[0] == 'T';
return b;
}
Apparently, there are no issues whatsoever when going in the opposite direction, SetValue always works without an exception regardless.
Ideally, you can detect this situation programmatically, and then do whatever the driver is set to produce.
Cheers _________________ Thanks,
-- Mike R. |
|