Senin, 09 Januari 2012

Button Simpan

Koneksi.Close()
Try
Koneksi.Open()
SQLCommand.Connection = Koneksi
SQLCommand.CommandType = CommandType.Text
SQLCommand.CommandText = "INSERT INTO TUAS Values ('" & TextBox1.Text & "', " & _
" '" & TextBox2.Text & "', " & _
" '" & TextBox3.Text & "', " & _
" '" & TextBox4.Text & "')"
SQLCommand.ExecuteNonQuery()
MsgBox("Sukses Tersimpan", MsgBoxStyle.OkOnly, "Sukses")
Catch ex As Exception
MsgBox("Npm Yang telah anda masukan telah ada")
End Try
Koneksi.Close()
tampilList()

Tidak ada komentar: