hi, i want to delete data in database from textbox. after i execute my program.there was error saying that oledbexeption was unhandelled and Syntax error in FROM clause.
can you help me..
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim data As String
Dim objCmd As New OleDbCommand
data = "delete FROM schedule ([subjek], [hari], [masa], [kelas], [tempat],[pensyarah]) "
data = data & "VALUES('" & (Me.TextBox1.Text) & "', '" & (Me.TextBox2.Text) & "','" & (Me.TextBox3.Text) & "','" & (Me.TextBox4.Text) & "','" & (Me.TextBox5.Text) & "','" & (Me.TextBox6.Text) & "' );"
Dim Con = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Asus\Documents\schedule table.accdb")
Con.Open()
objCmd = New OleDbCommand(data, Con)
objCmd.ExecuteNonQuery()
Con.Close()
MessageBox.Show("You have successfully delete the data.")
Con.Close()