How to enable the SQL to update all fields?
"UPDATE addresses SET "
+ "strCompany='" + strCompany + "',"
+ "Name='" + strName + "',"
+ "strAddress='" + strAddress + "',"
+ " strPhone='" + fields.phone.getText() +
"',"
+ " strHp='" + fields.hp.getText() + "',"
+ " strFax='" + fields.fax.getText() +
"',"
+ " strEmail='" + strEmail + "',"
+ " strStart='" +
fields.start.getText().trim() +
"',"
+ " intDay= '" + Integer.valueOf(dd) +
"',"
+ " intMonth='" + Integer.valueOf(mm) +
"',"
+ " intYear='" + Integer.valueOf(yy) +
"',"
+ " strMrc='" + fields.mrc.getText() +
"',"
+ " strIsp='" + fields.isp.getText() +
"',"
+ " strDes='" + fields.des.getText() +
"',"
+ " strSale='" + fields.sale.getText() +
"',"
+ " strContract='" +
fields.contract.getText() +
"',"
+ " strMark='" + fields.mark.getText() +
"'"
+ " WHERE strCompany='" + strCompany
+ "'"
+ "AND strName='" + strName + "'";
You can check out more about the UPDATE statement here:
http://msdn2.microsoft.com/en-us/library/ms177523.aspx
There are a few examples at the bottom of the page. Just paste those into Management Studio and run them.
No comments:
Post a Comment