Dear Experts
Please modify UPDATE codes according to INSERT codes Style.
'Insert Codes
Dim cmd As New SqlClient.SqlCommand("Insert Into employees (sno,Name, city, phone,img) Values (@sno,@Name, @city,@phone, @img)", con)
cmd.Parameters.Add(New SqlClient.SqlParameter("@sno", SqlDbType.Int)).Value = Val(Me.TextBox1.Text)
cmd.Parameters.Add(New SqlClient.SqlParameter("@name", SqlDbType.VarChar)).Value = Trim(Me.TextBox2.Text)
cmd.Parameters.Add(New SqlClient.SqlParameter("@city", SqlDbType.VarChar)).Value = Trim(Me.TextBox3.Text)
cmd.Parameters.Add(New SqlClient.SqlParameter("@phone", SqlDbType.VarChar)).Value = Trim(Me.TextBox4.Text)
cmd.Parameters.Add(New SqlClient.SqlParameter("@img", SqlDbType.Image)).Value = IO.File.ReadAllBytes(PictureBox1.ImageLocation)
cmd.ExecuteNonQuery()
MsgBox("Record inserted !! ")
'Update Codes
str = "UPDATE employees SET name = ' " & Trim(TextBox2.Text) & "',"
str &= "city = '" & Trim(TextBox3.Text) & "',"
str &= "phone= '" & Trim(TextBox4.Text) & "',"
str &= "img='arr_image' "
str &= " where sno = " & Val(TextBox1.Text)
ExecuteQuery(str)
MsgBox("Record updated !! ")
Please help