I have a code used to update mysql table. the first one is able to but
the second one does not. What is the difference between the two codes
apart from tables and the other components
[code]
accessDB1.connection();
string up = "update payment set dues = '" + txtDues.Text + "'";
accessDB1.myCmd(up).ExecuteNonQuery();
[/code]
[code]
//this does not update
soo.connection();
string soob = "Update terminals set computername = '"
+ txtcompname.Text + "',location='" + txtcomploc.Text + "' where termid
= '" + terminalid.Text + "'";
soo.myCmd(soob).ExecuteNonQuery();
[/code]
Loading
Sam HobbsPosted Dec 10, 2009, 2:02 PM
When saying things like "does not" to say that something does not work, usually it is necessary to be specific about what does happen. Do you get an error? What error? Note that SQL can fail if the data in the command has characters that make the command confusing. When you get an error that you don't understand and if you have not yet used a try/catch blocks, do that first before asking for help. Try the following or something equivalent: