Click here to Skip to main content
15,793,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,

i am retriving data from database.in retriving data one field is datatime field it gives output data as '5/28/2010 5:07:08 AM'
but in my database the output is like this '2010-05-28 05:07:08.703'
now i have to update a field in that table by using this date output.
these two are different values so i have no chance to update the record.so plz help me to convert this '5/28/2010 5:07:08 AM'
to '2010-05-28 05:07:08.703'
by using c# code

Thanks & regards,
S.Inayat basha.
Posted

1 solution

It's not like that. It's just the format that is different but the values are same. If you don't want to show the date in a specific format, you dont need it to match the format to insert/edit date as long as it's a valid date.

Try to update it normally as you do in your UI, SQL will automatically take care of it.
 
Share this answer
 
Comments
inayat basha 13-Jul-10 9:27am    
Reason for my vote of 4
that's good 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