Dim sql As String = ""
sql = "Select * From Employee Where emp_id='" & emp_id.Text & "'"
conn.Open()
cmd = New SqlCommand(sql, conn)
dr = cmd.ExecuteReader
dr.Read()
poscode.SelectedValue = dr.Item("poscode").ToString
depcode.SelectedValue = dr.Item("depcode").ToString
divcode.SelectedValue = dr.Item("divcode").ToString
dr.Close()
conn.Close()
พอรันแล้วคลิกปิดฟอร์มตรงกากบาทอ่ะนะค่ะจะเออเรอค่ะ
Invalid attempt to read when no data is present.
ตรง poscode.SelectedValue = dr.Item("poscode").ToString