Note that there are some explanatory texts on larger screens.

plurals
  1. POC# Update Multiple textbox for one column?
    primarykey
    data
    text
    <p>I got 5 textboxes and one button on my Windowform , and it's display data from my access database file.</p> <p>then i use update statement to update all the data key in into textbox1, textbox2, textbox3 and etc.</p> <p>my update statement:</p> <pre><code>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); </code></pre> <p>cmd.parameters.addwithvalue("ID", textbox10.text)</p> <p>but it's failed with no error.</p> <p>So i tried another mehod</p> <pre><code>cmd.parameters.addwithvalue("BALANCE", textbox5.text + textbox6.text + textbox7.text + textbox8.text + textbox9.text ); </code></pre> <p>and all the value i input go into textbox5. any method can i solve this?</p> <p>Sorry, im new..hopefully you're understand my problem.</p> <p><strong>EDIT</strong></p> <pre><code>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); </code></pre> <p>I put different number to different textbox, after that i preview the data, all the data value are the same...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload