you can write following query for inserting new row:
ConnObj.Open()
Dim mycommand As SqlCommand = New SqlCommand
mycommand.Connection = ConnObj
mycommand.CommandText = "insert into TableName" & " (branchId, productName) " & " VALUES (@branchId, @productName)"
mycommand.Parameters.AddWithValue("@branchId", textBox1.Text)
mycommand.Parameters.AddWithValue("@productName", textBox2.Text)
mycommand.ExecuteNonQuery()
ConnObj.Close()
or if you want to update any single row than you can do the following:
Dim myconn As New SqlConnection()
myconn = New SqlConnection(ConnectionString)
Dim mycom As SqlCommand = New SqlCommand()
mycom.Connection = myconn
myconn.Open()
mycom.CommandText = "update TableName set productName= @productName where branchId='" + textbox1.Text + "'"
mycom.Parameters.AddWithValue("@productName", textbox2.Text)
mycom.ExecuteNonQuery()
myconn.Close()
hope it will help you.