1
Answer

How to diplaying only time in DateTimePicker from Database

Sann Lin

Sann Lin

9y
420
1
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)