|
Yes and I've made the following observations. - When I retrieve data and pass to the client, it has Kind = Unspecified. I'm guessing this is because the SMALLDATETIME field in SQL Server doesn't store time zone information, so somewhere in taking SQL data and creating the entity, it passes that information. - When I add a new record client side, the date defaults to Kind = Local, which allows the problem to occur in the XML serialization. I am able to work around the problem if I intercept every single add/update before it goes to the SaveChanges() call. Maybe I'm out of touch with things, but I see where data binding is being pushed more and more so I attempt to use binding sources and bind to grids and such automatically. Using this approach, when I go to save, I have to interject code that loops through all possible entities and set all the date's Kind value. And just to complicate future development, if I add a field to the database and it happens to be a date field, well, I have to remember to go add some custom code to handle setting Kind. I've Googled and read most all of today and I'm just kind of shocked that either not that many people find this to be a problem or maybe just don't post about it. Even if I could go along with storing the time zone converted date in the database, has no one run into the problem where selecting a date from a calendar control gets time converted in the LINQ query and therefore querying a DATE field (no time here) results in a search for DATE+TIME (no results)? Last time I had to cross time zones in a thick client (I have to support disconnected and other factors), I used .net remoting, which apparently doesn't have the same issues. Seems like all this progress foreward in technology just takes several more steps to complicating development and causing more overhead. Enough babble on my part. :) So do you think the only way to preserve the local entered time is to intercept the data before SaveChanges() is called and set Kind? I haven't built a test SL app for this, but a disconnected SL app would have to run into the same issues (I guess a connected one would also since it executes locally).
|