I found it when I wrote a statement to calculate the loan interest. Strsql = "Update plus_bank set savemoney = savemoney (1 + @ lixi)-@ qukuan, savedate = @ savedate where userid =" + userid;
This error occurs during executenonquery, And the savemoney function cannot be found. However, the following statement can be used. It is strange that the SQL statement has such limitations.
Strsql = "Update plus_bank set savemoney = savemoney + savemoney * @ lixi-@ qukuan, savedate = @ savedate where userid =" + userid;
Sqlcommand cmd3 = new sqlcommand (strsql, myconn );
Parameters 3.parameters. Add ("@ lixi", sqldbtype. Float, 4). value = Rate * (datetime. Now. Year-mysavedate.Year + (datetime. Now. Month-mysavedate.Month ));
Parameters 3.parameters. Add ("@ qukuan", sqldbtype. Int, 4). value = myqukuan;
Parameters 3.parameters. Add ("@ savedate", sqldbtype. datetime, 4). value = datetime. now;
Try
{
Dr. Close ();
Statement 3.executenonquery ();
}
Catch (exception ex)
{
Response. Write ("Q exception capture! "+ Ex );
Response. End ();
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service