i have used ms access as backend
i have error in updating the record
the error as syntax error in update statement.the code i have written is as follows
Private Sub btnsubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsubmit.Click
GroupBox1.Visible = False
Dim strupdate As String
co = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\varsha2011\plotdetails\plotdetails\plot.mdb;")
strupdate = "UPDATE plot SET [group]='" & txtgroup.Text & "' ,plotno=" & CInt(txtplot.Text) & ", area='" & txtarea.Text & "' ,variety='" & txtvariety.Text & "',farmername='" & txtname.Text & "',dist bet rows=" & CInt(txtrow.Text) & ",area per plant=" & CInt(txtplant.Text) & ",dist bet plants=" & CInt(txtperplant.Text) & ",no of per plant cost=" & CInt(txtnoplant.Text) & ",area plot acre=" & CInt(txtareacre.Text) & ",canopy syatem='" & txtcanopy.Text & "' ,date of forwardpruning=#" & DateTimePicker1.Value & "# ,stage=" & CInt(txtstage.Text) & " ,no of canes required=" & CInt(txtcanesreq.Text) & ",no of canes actual=" & CInt(txtcanesactual.Text) & ",no of sprout=" & CInt(txtsprout.Text) & ",no of bunch required=" & CInt(txtbunch.Text) & ",no of bunch actual=" & CInt(txtbunchactual.Text) & ",no of leaves=" & CInt(txtleaves.Text) & ",avg length of leaves=" & CInt(txtlen.Text) & ",avg breadth=" & CInt(txtbreadth.Text) & ",area per plant=" & CInt(txtareaperplant.Text) & ",date of backward pruning=#" & DateTimePicker1.Value & "#,no of canes=" & CInt(txtcanesbackward.Text) & ",no of canes sq ft=" & CInt(txtcanessqft.Text) & ",thickness of canes=" & CInt(txtthickness.Text) & ",area of leaf=" & CInt(txtarealeaf.Text) & ",leaf index=" & CInt(txtleafindex.Text) & " where fileno=" & txtse.Text & ";"
MsgBox(strupdate)
cm = New OleDbCommand(strupdate, co)
cpen()
cm.ExecuteNonQuery()
MessageBox.Show("updates successfully", "update", MessageBoxButtons.OK)
co.Close()
i have error in updating the record
the error as syntax error in update statement.the code i have written is as follows
Private Sub btnsubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsubmit.Click
GroupBox1.Visible = False
Dim strupdate As String
co = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\varsha2011\plotdetails\plotdetails\plot.mdb;")
strupdate = "UPDATE plot SET [group]='" & txtgroup.Text & "' ,plotno=" & CInt(txtplot.Text) & ", area='" & txtarea.Text & "' ,variety='" & txtvariety.Text & "',farmername='" & txtname.Text & "',dist bet rows=" & CInt(txtrow.Text) & ",area per plant=" & CInt(txtplant.Text) & ",dist bet plants=" & CInt(txtperplant.Text) & ",no of per plant cost=" & CInt(txtnoplant.Text) & ",area plot acre=" & CInt(txtareacre.Text) & ",canopy syatem='" & txtcanopy.Text & "' ,date of forwardpruning=#" & DateTimePicker1.Value & "# ,stage=" & CInt(txtstage.Text) & " ,no of canes required=" & CInt(txtcanesreq.Text) & ",no of canes actual=" & CInt(txtcanesactual.Text) & ",no of sprout=" & CInt(txtsprout.Text) & ",no of bunch required=" & CInt(txtbunch.Text) & ",no of bunch actual=" & CInt(txtbunchactual.Text) & ",no of leaves=" & CInt(txtleaves.Text) & ",avg length of leaves=" & CInt(txtlen.Text) & ",avg breadth=" & CInt(txtbreadth.Text) & ",area per plant=" & CInt(txtareaperplant.Text) & ",date of backward pruning=#" & DateTimePicker1.Value & "#,no of canes=" & CInt(txtcanesbackward.Text) & ",no of canes sq ft=" & CInt(txtcanessqft.Text) & ",thickness of canes=" & CInt(txtthickness.Text) & ",area of leaf=" & CInt(txtarealeaf.Text) & ",leaf index=" & CInt(txtleafindex.Text) & " where fileno=" & txtse.Text & ";"
MsgBox(strupdate)
cm = New OleDbCommand(strupdate, co)
cpen()
cm.ExecuteNonQuery()
MessageBox.Show("updates successfully", "update", MessageBoxButtons.OK)
co.Close()