Skrip programnya sebagai berikut :

Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TextBox1.Text = "  "
        TextBox2.Text = "  "
        TextBox3.Text = "  "
        TextBox4.Text = "  "
        TextBox5.Text = "  "
        TextBox6.Text = "  "
        TextBox7.Text = "  "
        TextBox8.Text = "  "
        ComboBox1.Items.Add(" Buku Tulis ")
        ComboBox1.Items.Add(" Pencil ")
        ComboBox1.Items.Add(" Majalah ")
        ComboBox1.Items.Add(" Ballpoint ")
        ComboBox1.Items.Add(" Buku Gambar ")
        ComboBox1.Items.Add(" Penghapus ")
        ListBox1.Items.Add(3400)
        ListBox1.Items.Add(2500)
        ListBox1.Items.Add(5000)
        ListBox1.Items.Add(3000)
        ListBox1.Items.Add(4500)
        ListBox1.Items.Add(800)
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Text = "  "
        TextBox2.Text = "  "
        TextBox3.Text = "  "
        TextBox4.Text = "  "
        TextBox5.Text = "  "
        TextBox6.Text = "  "
        TextBox7.Text = "  "
        TextBox8.Text = "  "
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim nama As String
        Dim alamat As String
        Dim barang As String
        Dim harga As Integer
        Dim jbeli As Integer
        Dim total As Double
        Dim discount As Double
        Dim jmlbayar As Double
        Dim jmluang As Double
        Dim kembali As Double
        nama = TextBox1.Text
        alamat = TextBox2.Text
        jbeli = Val(TextBox3.Text)
        jmluang = Val(TextBox7.Text)
        barang = ComboBox1.Text
        harga = ListBox1.SelectedItem
        total = harga * jbeli
        discount = total * 0.05
        jmlbayar = total - discount
        kembali = jmluang - jmlbayar
        TextBox4.Text = total
        TextBox8.Text = kembali
        TextBox5.Text = discount
        TextBox6.Text = jmlbayar
    End Sub
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Me.Close()
    End Sub
End Class

Semoga bermanfaat dan selamat mencoba.
jangan lupa komentar ya..hehe

sumber : materi kuliah


Skrip programnya sebagai berikut :


Imports MySql.Data.MySqlClient
Public Class Pelanggan
    Dim kon As New MySqlConnection("server=localhost;User Id=root;database=penjualan")
    Dim perintah As New MySqlCommand
    Dim data As New MySqlDataAdapter
    Dim ds As New DataSet
    Sub tampildata()
        kon.Open()
        perintah.Connection = kon
        perintah.CommandType = CommandType.Text
        perintah.CommandText = "select*from pelanggan"
        data.SelectCommand = perintah
        ds.Tables.Clear()
        data.Fill(ds, "pelanggan")
        DataGridView1.DataSource = ds.Tables("pelanggan")
        kon.Close()
    End Sub
    Private Sub Form1_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
        tampildata()
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        kon.Open()
        perintah.Connection = kon
        perintah.CommandType = CommandType.Text
        perintah.CommandText = "insert into pelanggan (kd_plg,nm_plg,alamat) values ('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "')"
        perintah.ExecuteNonQuery()
        kon.Close()
        MsgBox("data sukses tersimpan", MsgBoxStyle.Information, "pesan")
        tampildata()
    End Sub
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        End
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        kon.Open()
        perintah.Connection = kon
        perintah.CommandType = CommandType.Text
        perintah.CommandText = "delete from pelanggan where alamat= '" & TextBox3.Text & "'"
        perintah.ExecuteNonQuery()
        kon.Close()
        MsgBox("data telah dihapus", MsgBoxStyle.Information, "informasi")
        tampildata()
    End Sub
    Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
        Dim i As Integer
        i = DataGridView1.CurrentRow.Index
        With DataGridView1.Rows.Item(i)
            TextBox1.Text = .Cells(0).Value
            TextBox2.Text = .Cells(1).Value
            TextBox3.Text = .Cells(2).Value
        End With
    End Sub
End Clas

Semoga bermanfaat dan selamat mencoba.
kalau ada yang kurang jelas silahkan ditanyakan..
sumber: materi kuliah