hi can someone please help me in updating one column in a table but you will be using three values from a textbox..
it was like this.
tablebook
column in tablebook is quantity
i need to update a book quantity using the value from textbox1. but
wat if i have a value from textbox2 and textbox3
i need to update textbox1,textbox2,textbox3 values into book quantity where it has different bookname
sample of my coding
If TextBox1.Text <> "" And TextBox2.Text <> "" And TextBox4.Text <> "" Then
SqlCon.Open()
sqlCommand.Connection = SqlCon
sqlCommand.CommandText = "UPDATE books SET quantity = " & qt1.Text - 1 & " WHERE book_ID = '" & TextBox1.Text & "'"
sqlCommand.ExecuteNonQuery()
SqlCon.Close()
update_quantity_borrow()
SqlCon.Open()
sqlCommand.CommandText = "UPDATE books SET quantity = " & q2.Text - 1 & " WHERE book_ID = '" & TextBox2.Text & "'"
sqlCommand.ExecuteNonQuery()
SqlCon.Close()
update_quantity_borrow()
SqlCon.Open()
sqlCommand.CommandText = "UPDATE books SET quantity = " & q3.Text - 1 & " WHERE book_ID = '" & TextBox4.Text & "'"
sqlCommand.ExecuteNonQuery()
SqlCon.Close()
update_quantity_borrow()
End If