ASP.NET Letter将应用程序发送给不同的用户。 [英] ASP.NET Letter sending application to different users.

查看:59
本文介绍了ASP.NET Letter将应用程序发送给不同的用户。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个向不同用户发送信件的asp.net应用程序。



我创建了一个存储字母的sql表(可以发送信件)同时向多个用户)。



i已经实现但问题是当我在DB中存储信件时我将其状态设置为未读。 />


当用户打开他的个人资料时,会显示特定用户的未读信件,但当他将状态标记为READ时,状态会更新为所有用户AS中的READ。 ...而其他人无法查看他们的信件...



请提出解决该问题的方法

提前感谢!

I am developing an asp.net application which send letters to different users.

I have created one sql table in which letters is stored(letter can be sent to more than one users at the same time) .

i have implemented but the the problem is when i m storing letter in DB i set its status "Unread".

when user open his profile unread letters for particular user is shown but when he mark the status as "READ" then the status updated to all users AS "READ" in DB.... and others cannot view their letters...

kindly propse a solution for that problem
THANKS in advance!

推荐答案

因此,似乎在您更新时,您忘记为特定用户添加条件。



你需要形成如下的查询。

So, it seems like when you are updating, you forgot to add the condition for the particular user.

You need to form the query like below.
UPDATE Letter
SET Status = 'READ'
WHERE UserId = @UserId



这里 @ UserId 是参数。您应该向其提供当前的 UserId 值。


Here @UserId is the parameter. You should provide the current UserId value to it.


这篇关于ASP.NET Letter将应用程序发送给不同的用户。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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