1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Private Sub TextBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.LostFocus
Dim ssql As String
ssql = "select case * when htl_nom = nomhotel then msg1 else msg2 from hotel ;"
Dim objConn As New System.Data.OleDb.OleDbConnection(sconnection)
Dim objcmd As New System.Data.OleDb.OleDbCommand(ssql, objConn)
Dim objReader As System.Data.OleDb.OleDbDataReader
Try
objConn.Open()
Catch ex As Exception
End Try
If objConn.State = ConnectionState.Open Then
Try
Stop
objReader = objcmd.ExecuteReader
Catch ex As Exception
MessageBox.Show(ex.message)
End Try
End If
End Sub |