Advertisement
asril99

Untitled

Dec 8th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. perintah.Connection = kon
  2. perintah.CommandType = CommandType.Text
  3. perintah.CommandText = "INSERT INTO barang_tbl VALUES('" & TextBox1.Text & "'," &
  4. "'" & txt_nama.Text & "','" & txt_barang.Text & "','" & txt_jumlahbarang.Text & "', " &
  5. "'" & txt_satuanbarang.Text & g & "')"
  6. perintah.ExecuteNonQuery()
  7. mda.SelectCommand = perintah
  8. perintah.CommandText = "select * from barang_tbl"
  9. ds.Tables.Clear()
  10. mda.Fill(ds, "data")
  11. DataGridView1.DataSource = ds.Tables("data")
  12. kon.Close()
  13. MsgBox("Data Berhasil Disimpan..!!", MsgBoxStyle.Information, "Pesan")
  14. bersih()
  15. Catch ex As Exception
  16. MessageBox.Show("Query Error " & ex.Message)
  17. End Try
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement