Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim sql As String = "Select * from Liberial where Username = '" & TextBox1.Text & "' and Password1='" & TextBox2.Text & "'"
Dim conn As New OleDbConnection(strconn)
Dim objDR As OleDbDataReader
Dim Cmd As New OleDbCommand(sql, conn)
da = New OleDbDataAdapter(sql, conn)
da.Fill(ds, "detail")
If ds.Tables("detail").Rows.Count <> 0 Then
isfind = True
conn.Open()
objDR = Cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
While objDR.Read()
TextBox3.Text = objDR("Liberial_ID")
TextBox4.Text = objDR("Name_liberial")
End While
Class1.Srt = TextBox3.Text
Class1.Srt1 = TextBox4.Text
Menu1.ShowDialog()
Me.Dispose()
Else
MsgBox("รหัสผ่านไม่ถูกต้อง", MsgBoxStyle.Information, "แจ้งเตือน")
End If
End Sub