Hey All,
I've got a winforms .net 2.0 application that's hitting a MS SQL 2008 server. I load up a DataSet from that server, expose a bunch of that dataset via bound winform controls & then push updates via SqlDataAdapters.
One such adapter is attached to a table w/two key fields RecruitID and StatusDate. StatusDate is a DateTime field on the server, and System.DateTime in the DataSet.
I'm getting DBConcurrencyExceptions lately I think b/c of the formatting of the date info. If I capture the SQL that the adapter is generating, I see WHERE conditions like:
WHERE (RecruitID = 236) AND (StatusDate = '2010-05-27 04:45:34.053')
When what they should be is:
WHERE (RecruitID = 236) AND (StatusDate = '2010-05-27 16:45:34.053')
So--hours should be in military time--that's what shows if I query the proper record out of the db in mssql management studio. I'm not sure where the translation from military to am/pm style time is happening, so I don't know where to try and stop it.
This date is being displayed in a DataGrid. The relevant DataGridColumnStyle instance has a .Format property = 'g', which turns the above date into "5/27/2010 4:45 PM" for display. If I remove that 'g' format property it doesn't make any difference.
Can anybody throw me a clue here?
Many thanks in advance!
-Roy