Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have datetime field in database and Value is

2013-09-04 16:30:44.000

when i fetch this value in c# by using

dataadapter.fill(datatable)

it returns 2013-09-04 16:30:44 and truncate milisecond .

Any solution?
Posted
Comments
[no name] 4-Sep-13 7:23am    
Okay so what is the problem? Format your display to show 000 milliseconds.

It may not be an issue ; 16:30:44 and 16:30:44.000 are the same value.

It could be useful to test with a value whose decimal part is not zero (eg: 16:30:44.389) and see what happens.

Maybe you should force the display of milliseconds in your code to see the exact value you get.

Without any given code, it's impossible to diagnose the real issue (a value issue, or a formatting issue).
 
Share this answer
 
Comments
phil.o 4-Sep-13 7:36am    
Please show us some code ; we developpers do not like to have to guess problems, we need an actual code to work with...
Check the data types you are using to store that value. Read the description. Make sure it does store fractions of a second. Then make sure when you check or output the value, that you do display the full value and not skip the fraction, or accidentally convert it to int, losing the fraction.

If you want more specific advice, show us the code you use to read, store, retrieve, and display the date value. Specifically include the data types and any code that moves or modifies the value.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900