如何在控制器MVC中计算值 [英] How to counter Value in controler MVC
本文介绍了如何在控制器MVC中计算值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用后对数据库值有问题。
示例:我有Table ParameterCounter,其{Id和CounterValue}值{1,1}
我想在使用1之后更新Counter值然后在数据库中我在Mysql中有值{1,2}
我有查询UPDATE parameterCount SET counterValue = counterValue + 1;"但如何在MVC的控制器中转换该查询?
如果你可以帮助我,我将不胜感激。
exactly i have a problem for counter the database value after I use .
example : I have Table ParameterCounter which have { Id and CounterValue } Value {1,1}
I want to update Counter value after I use 1 then in data base i have Value {1,2}
in Mysql i have query "UPDATE parameterCount SET counterValue = counterValue + 1 ;" but how to transform that query in controler of MVC?
if you can help me I will be appreciate it.
推荐答案
使用ADO。 net与数据库交互。
初学者理解ADO.NET的教程 [ ^ ]
Use ADO.net to interact with the database.
A Beginner's Tutorial for Understanding ADO.NET[^]
这篇关于如何在控制器MVC中计算值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文