| Lonifasiko 2006-03-07, 9:24 am |
| I was running this query against SQL Mobile 2005 database:
select * from Appointment where Appointment.appointmentDate >= {0} AND
Appointment.appointmentDate <= {1}
I was using parameters in order to insert the two datetime values in
the SQLCeCommand object.
All was working perfect but suddenly application started to crash ad
giving "native" errors, that is, no exceptions were thrown, application
just was exiting with "native error". I just have generated a new
database model, but I haven't changed this table at all!
"appointmentDate" is a simple datetime column. If I query SQL Server
instead of SQL Mobile 2005, query returns desired rows. Therefore,
problem is related to SQL Mobile 2005.
If I only use "select * from Appointment where
Appointment.appointmentDate >= {0} " or
"select * from Appointment where Appointment.appointmentDate <= {0} ",
the query runs ok.
But seems like egine does not like two datetime values comparison, al
least sometimes.
I've switched my select to "between" and query runs ok now, but I
cannot explain what has hapenned with my "old select".
Any ideas? Has somebody suffered this misterious behaviour before?
Thanks in advance.
|