Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27329

VS 2010 Displaying Time in Datagridview

$
0
0
I am converting an employee clocking application which previously used a MS Access database to Pervasive SQL database. Clock times are stored in the database with the Time datatype. I am trying to display this data in a datagridview. When I view the data within the SQL database itself, it appears as 03:30 PM, but when it displays in my datagridview, it appears as 15:30:00 (military time). I am unable to get the cells to format it in any other way. In MS Access, and was stored as a DateTime, which allowed me to use the DefaultCellStyle.Format= "hh:mm tt" method to format. However, that throws an exception "Input String was not in a correct format."

Any ideas on how to format this data?

Viewing all articles
Browse latest Browse all 27329

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>