Tuesday, 15 September 2015

C# Update Multiple textbox for one column? -


I got 5 text boxes and a button on my windowform, and it displays data from my Access database file.

updating

  as cmd = new oledbcommand ( "I"), I enter all data keys 1, textbox 2, text box 3 and etc. I'm using an update statement for  Updated Table 2 Set Balance =? "+" Where ID =? "Con); Cmd.parameters.addwithvalue (" BALANCE ", textbox5.text); Cmd.parameters.addwithvalue (" BALANCE ", textbox6.text); Cmd.parameters.addwithvalue (" BALANCE ", textbox7.text); Kandkparamitrskaddvitvlua ( "Balance", Tekstboks8ktekst); Kandkparamitrskaddvitvlua ( "Balance", Tekstboks9ktekst);   

Kandkparamitrskaddvitvlua ( "id" , Textbox10.text)

but it failed with some error.

So I did the second attempt

  cmd.parameters.addwithvalue ("Balance", text box 05. text + text box 6. text + text box 7. text + text box 8. text + text box 9. text);   

and all the values ​​I have to go to input textbox5.

Edit

  

I have a CMD = new Olebkandend ( "trying to update table 2 ST Balance =?", con) of; 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 have entered different numbers in different text boxes, after that I preview the data, all data values ​​are the same ...

  cmd.parameters.addwithvalue ("BALANCE", textbox5.text + "," + textbox6.text + ", "+ Textbox7.text +", "+ Textbox8.text +", "+ textbox9.text);   

And when you want to divide them by ,

No comments:

Post a Comment