string insertNrContract = "INSERT INTO client (nr_contract) VALUES ('"
+ nr_contract + "') WHERE id_client='" + id_client + "'";
and i get the error:Incorrect syntax near the keyword 'WHERE'. I don't get what's missing. Any help? thanks

Satyapriya NayakPosted Apr 14, 2013, 6:55 AM
use for update
string updateNrContract = "UPDATE client SET nr_contract='" + nr_contract.text + "' WHERE id_client='" + id_client .text+ "'";
Violeta PopaPosted Apr 14, 2013, 9:28 AM
Ravi ShekharPosted Apr 14, 2013, 7:21 AM
sandeep TomarPosted Apr 14, 2013, 6:58 AM
because where clause can not be use with insert , INSERT query simply insert a new row so please use update query
string insertNrContract = "UPDATE client SET nr_contract='" + nr_contract + "' WHERE id_client='" + id_client + "'";