Sann Lin

Sann Lin

  • NA
  • 9
  • 4.7k

How to diplaying only time in DateTimePicker from Database

Jul 8 2015 12:45 AM
I have Tbl_Session table and it has columns
time_In (time 7)
time_Out (time 7)

and DateTimePicker format (Time)

And below is my code

Private Sub dgvSession_CellMouseClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles dgvSession.CellMouseClick
Try
If e.RowIndex >= 0 Then
Dim row As DataGridViewRow = dgvSession.Rows(e.RowIndex)
dateTimeIn.Value = row.Cells("time_In").Value
dateTimeOut.Value = row.Cells("time_Out").Value
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try

When I click on row it shows message error like this
 
 

Answers (1)