如何在MVC中自动更新计数器 [英] How To automatic update counter in MVC

查看:86
本文介绍了如何在MVC中自动更新计数器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得pc.counter(Int)值并传递给search.counting(varchar)

之后数据库中的pc.counter值可以计数器



这里我的数据库设计数量



I wanna get pc.counter(Int) value and passing to search.counting(varchar)
after that value of pc.counter in database can be counter

here my database design of count

CREATE TABLE [dbo].[parameterCount] (
    [Id]      INT NOT NULL,
    [counter] INT NULL,
    PRIMARY KEY CLUSTERED ([Id] ASC)
);





这里是我尝试过的但仍然不能正常工作。



and here it is what I tried but still not working.

search.counting = pc.counter.ToString();
          pc.counter++;





如果你可以帮助我,我会很感激



if you can help me, I would appreciate it

推荐答案

请详细说明你想要什么?就像你的柜台应该增加或它应该更新数据库等......
Please explain more what do you want exactly?? Like your counter should increase or it should update database etc...


这篇关于如何在MVC中自动更新计数器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆