Powered By Blogger

Kamis, 09 Juni 2011

vb2

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call bukakoneksi()

End Sub
Sub Jurusan()
Call bukakoneksi()
Tampil2.Connection = database
Tampil2.CommandType = CommandType.Text
tampil2.CommandText = "select * from jurusan where kdjur='" & Trim(TextBox1.Text) & "'"
Tampilkan = Tampil2.ExecuteReader

If Tampilkan.HasRows = True Then
While Tampilkan.Read()
If IsDBNull(tampilkan("kdjur")) Then
Else
TextBox2.Text = tampilkan("nmjur")
End If
End While
End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Call Jurusan()

End Sub
End Class

Tidak ada komentar:

Posting Komentar