I have the following code that will update one field called RCon in sql, does anyone know how i can update a few at the same time?
i would like to update the sql field (called stockdesc)
Dim con As New SqlConnection
Dim cmd As New SqlCommand
Try
con.ConnectionString = "Data Source=10.10.0.25;Initial Catalog=RConditions;Persist Security Info=True;User ID=mbish;Password=mbish"
con.Open()
cmd.Connection = con
cmd.CommandText = "update LN2 SET RCon = @RCon where Stkcode = @stkcode"
cmd.Parameters.AddWithValue("@RCon", Me.txtLine2Rcon.Text)
cmd.Parameters.AddWithValue("@stkcode", Me.txtStockCode.Text)
cmd.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show("Error while inserting record on table..." & ex.Message, "Insert Records")
Finally
con.Close()
End Try