tags:

views:

87

answers:

1

i am trying this

Datetime t=Convert.ToDateTime(row["TimeStamp"])

i am getting this record from Database dat contains the milliseconds too but when i do this i lose the milliseconds how can i get the milliseconds

A: 

From this MSDN article on ToDateTime it looks like either a string or an object is being passed in. Either way, the method returns a DateTime object, which has properties Millisecond, Second etc. So, I suggest you try:

t.Millisecond

If its value is 0 then check that there are milliseconds in the original string, not just seconds.

Phil H