I am getting error while updating data in SQL in vb.net. I am using VS2013.
Since query is long so I have separated using "&_" .
-----------------------------------------------------------------------------
Code:
-----------------------------------------------------------------------------
con.Open()
ss = "UPDATE emp_master set empid=" & txtempid.Text & ",empname='" & txtename.Text & "',pfno='" & txtpfno.Text & "',dob=" & dtpdob.Value & ",gender='" & g & "'," & _
"contact=" & txtcontact.Text & ",email='" & txtemail.Text & "',doj=" & dtpdoj.Value & ",address='" & txtaddress.Text & "',edu='" & txtedu.Text & "'," & _
"nationality='" & txtNation.Text & "',bloodgroup=" & cmb_Bloodgrp.SelectedText & ", desig='" & txtdesig.Text & "',exp=" & txtexp.Text & ",salary=" & txtsalary.Text & "," & _
"dept='" & txtdept.Text & "',pic=" & arrImg.ToString() & ",usertype=" & Cmb_utype.SelectedText & " WHERE empid=" & txtempid.Text & " "
com = New SqlCommand(ss, con)
com.ExecuteNonQuery()
MsgBox("Data Updated Successfully !", MsgBoxStyle.Information, MsgBoxStyle.OkCancel)
con.Close()
----------------------------------------------------------------------------
Error:
---------------------------------------------------------------------------
Additional information: Incorrect syntax near ','.
An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Change the alias to a valid name.