Skip to main content

Posts

Showing posts with the label Handheld

GETDATE() and DST in SQL Server Compact

We have had issues when synchronizing date and time in some handheld Windows CE devices. Time always seem to get an hour wrong and we have already confirmed that it has to do with Daylight Savings Time. But we have not figured out what and why until just recently. In some cases we have used the SQL method  GETDATE() , in other cases  DateTime.Now() . The case where the latter is used there are never any issues, but with  GETDATE() we get the one hour difference most of the time. This is simply caused by the settings and configuration in the handheld device and SQL Server Compact. A proper solution would be always to use  UTC -date in the application and the database to get rid of such problems. But since that would be a major change we decided to just go with using DateTime.Now()  instead of GETDATE() .

Problems and solutions

This week has been lined with clumsiness, weird problems and some pride. The latter because I actually managed to conquer the problems. The clumsiness was just me managing to shut myself out from my computer. All accounts except the domain accounts were disabled, the domain cache was disabled and network settings not allowing contact with the domain. That is not a good combination. Thanks to  Offline NT Password & Registry Editor  I got in again just fine. The reason this all happened was mainly a security aspect, but combined with the poor network settings it turned out to be way too secure. The weird problems had to with our Windows CE application. As usual the information supplied from the users is very limited, like  "it doesn't work" . But when I finally got my hands on the log files I got even more confused. Weird problems in the shape of  SqlCeExceptions , no GPRS connection, sudden torn-offs... It turned out to be a memory card that was loose. The dat...