SELAMAT DATANG DI BLOG BERBAGI PENGETAHUAN BERSAMA SAYA ANESIADAMA

Selasa, 23 Februari 2016

Listing Login

Listing
Form 1
Imports System.Data.Odbc
Public Class Form1
    Dim CMD As New OdbcCommand
    Dim RD As OdbcDataReader

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox1.Text = "" Or TextBox2.Text = "" Then
            MsgBox("data login belum lengkap")
            Exit Sub
        Else
            Call Koneksi()

            CMD = New OdbcCommand("select * from pegawai where nama='" & TextBox1.Text & "' and pass='" & TextBox2.Text & "' ", Conn)
            RD = CMD.ExecuteReader
            RD.Read()
            If RD.HasRows = True Then
                Form2.Show()
            Else
                MsgBox("data tidak ada")
            End If

        End If


    End Sub

    Private Sub FormLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TextBox1.MaxLength = 20
        TextBox2.PasswordChar = "*"
        TextBox1.Clear()




1 komentar: