Friend Function cmd_excuteScalar()
connect_open()
cmd = New SqlCommand(sql, cn)
Return cmd.ExecuteScalar
End Function
sql = "select count(*) from customer where cus_idcard= '" & txt_idcard & "'"
If cmd_excuteScalar() > 0 Then
msg_error("มีเลขบัตรประชาชนนี้แล้ว")
Return
End If