I have a SQL Server table with a CreatedDate field of type DateTimeOffset(2).
A sample value which is in the table is 2010-03-01 15:18:58.57 -05:00
As an example, from within C# I retrieve this value like so:
var cmd = new SqlCommand("SELECT CreatedDate FROM Entities WHERE EntityID = 2", cn);
var da = new SqlDataAdapter(cmd);
DataTable dt =new DataTable();
da.Fill(dt);
And I look at the value:
MessageBox.Show(dt.Rows[0][0].ToString());
The result is 2010-03-01 15:18:58 -05:00, which is missing the .57 that is stored in the database.
If I look at dt.Rows[0][0] in the Watch window, I also do not see the .57, so it appears it has been truncated.
Can someone shed some light on this? I need to use the date to match up with other records in the database and the .57 is needed.
Thanks!
Darvis