Click here to Skip to main content
15,904,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
i have a application in which i have to add columns to a datagridview as "Modifieddate" column in database...
While getting data from database using sqldataadapter it is not getting milliseconds ..so if i modified data within a second then two records with same date are coming...it is giving error while binding to datagridview....(Here column name is repeating while binding)


How can i get milliseconds also from database using sqldataadapter

in database it is "2013-07-31 16:31:36.193"
in dataadapter it it "31-07-2013 PM 04:31:36"
Posted
Comments
[no name] 1-Aug-13 4:37am    
Time stamp is not a good key for records. Time stamps are NOT unique. What happens when clock is reset (eg daylight saving) etc etc. The milliseconds issue just tells you it is a bad idea. Abandon it before it bites you even harder.
pullareddy S 1-Aug-13 6:50am    
hi i find the solution
SELECT distinct convert(varchar(24),[ModifiedDate],113) as modifieddate from Table2

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