Welcome navachaitanya.
Read How to post? .
Your code should be surrounded by BB Code Tags.
Private Sub UpdateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpdateButton.Click
Try
Dim com As New OleDbCommand
com.Connection = con
com.CommandText = "Update Details Set CUSTOMERNAME= '" & TextBoxcname.Text & "',CUSTOMERNO= '" & TextBoxcno.Text & "',TYPEOFORDER= '" & TextBoxtypordr.Text & "',OPTION= '" & TextBoxoption.Text & "',GIVENSAMPLE='" & TextBoxgivensample.Text & "',DATEOFORDER= '" & TextBoxdateordr.Text & "',DATEOFDELIVERY= '" & TextBoxdatedely.Text & "',TOTALAMOUNT='" & TextBoxtotalamt.Text & "',ADVANCEAMOUNT='" & TextBoxadvamt.Text & "',BALANCEAMOUNT='" & TextBoxbalamt.Text & "',TOP_TL='" & TextBoxtoptl.Text & "',TOP_HEM='" & TextBoxtophem.Text & "',TOP_SLIT='" & TextBoxtopslit.Text & "',TOP_HIP='" & TextBoxtophip.Text & "',TOP_WST='" & TextBoxtopwst.Text & "',TOP_CHST='" & TextBoxtopchst.Text & "',TOP_SH='" & TextBoxtopsh.Text & "',TOP_SL='" & TextBoxtopsl.Text & "',TOP_AH='" & TextBoxtopah.Text & "',TOP_NECK NO='" & TextBoxtopneckno.Text & "',TOP_NECK A='" & TextBoxtopnecka.Text & "',TOP_NECK B='" & TextBoxtopneckb.Text & "',BOTTOM_TL='" & TextBoxbottomtl.Text & "',BOTTOM_HEM='" & TextBoxbottomhem.Text & "',BOTTOM_CAL='" & TextBoxbottomcal.Text & "',BOTTOM_KNEE='" & TextBoxbottomknee.Text & "',BOTTOM_THI='" & TextBoxbottomthi.Text & "',BOTTOM_HIP='" & TextBoxbottomhip.Text & "',BOTTOM_WST='" & TextBoxbottomwst.Text & "',BOTTOM_CRO='" & TextBoxbottomcro.Text & "',BOTTOM_SLIT='" & TextBoxbottomslit.Text & "',ZIP = '" & TextBoxbottomzip.Text & "' where INVOICENO='" & TextBoxinvcno.Text & "'"
con.Open()
com.ExecuteNonQuery()
con.Close()
MsgBox("Record Updated")
Call Md_Settings()
Call Md_ClearAll()
Catch
MsgBox("Error")
End Try
End Sub
You should start to learn about Parameterized or Pre-compiled sql statement (Stored procedures etc) in VB.NET.
__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241