Minggu, 28 Oktober 2012

SCRIB DBMS SIMPAN

//SIMPAN//


Imports System
Imports System.Data
Imports System.Data.OleDb




Public Class Form1

    Private Sub button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button.Click
        Dim koneksi As New OleDbConnection("provider=Microsoft.ace.oledb.12.0;Data source=\rekap\Database1.accdb")
        koneksi.Open()
        Dim input As String = "insert into master_mhs(NIM,NAMA,ALAMAT,NO HP,JURUSAN,FAKULTAS)values('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "')"
        Dim command As New OleDbCommand(input, koneksi)
        Dim reader As OleDbDataReader = command.ExecuteReader
        reader.Close()
        koneksi.Close()
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox5.Text = ""
        TextBox6.Text = ""
        TextBox1.Focus()



    End Sub
End Class

0 komentar:

Posting Komentar

Popular Posts