I got 5 textboxes and one button on my Windowform , and it's display data from my access database file.
then i use update statement to update all the data key in into textbox1, textbox2, textbox3 and etc.
my update statement:
cmd = new oledbcommand("UPDATE Table2 SET BALANCE = ? " + " WHERE ID = ? ", con);
cmd.parameters.addwithvalue("BALANCE", textbox5.text);
cmd.parameters.addwithvalue("BALANCE", textbox6.text);
cmd.parameters.addwithvalue("BALANCE", textbox7.text);
cmd.parameters.addwithvalue("BALANCE", textbox8.text);
cmd.parameters.addwithvalue("BALANCE", textbox9.text);
cmd.parameters.addwithvalue("ID", textbox10.text)
but it's failed with no error.
So i tried another mehod
cmd.parameters.addwithvalue("BALANCE", textbox5.text + textbox6.text + textbox7.text + textbox8.text + textbox9.text );
and all the value i input go into textbox5. any method can i solve this?
Sorry, im new..hopefully you're understand my problem.
EDIT
I tried to cmd = new oledbcommand("UPDATE Table2 SET BALANCE = ? ", con);
cmd.parameters.addwithvalue("BALANCE", textbox5.text);
cmd.parameters.addwithvalue("BALANCE", textbox6.text);
cmd.parameters.addwithvalue("BALANCE", textbox7.text);
cmd.parameters.addwithvalue("BALANCE", textbox8.text);
cmd.parameters.addwithvalue("BALANCE", textbox9.text);
I put different number to different textbox, after that i preview the data, all the data value are the same...