23-10-12, 12:43 AM
أعتذر عن التأخير و شكرا لأخواني الذين سبقوني
PHP كود :
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
Try
With cmnd
.Connection = conn
.CommandType = CommandType.Text
.CommandText = "select * from users where uname = @uname and pword = @pword"
With .Parameters
.Clear()
.AddWithValue("@uname", OleDbType.VarChar).Value = tb_user.Text.Trim
.AddWithValue("@pword", OleDbType.VarChar).Value = tb_pword.Text.Trim
End With
If conn.State = ConnectionState.Open Then conn.Close()
conn.Open()
redr = cmnd.ExecuteReader
If redr.Read Then
redr.Close()
MsgBox("Done")
Form1.Show()
Else
MsgBox("Wrong Username Or Password")
redr.Close()
End If
conn.Close()
End With
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub

