积极答复者
关于并发问题的疑惑

问题
答案
-
在数据库里新增一个时间的时段 当用户读取这个字段的时候同时也读取了时间这个字段 然后 操作时做个时间的比较……
在Page_Load中:if(!IsPostBack)
{
using (SqlCommand cmd = new SqlCommand("select top 1 DataTimeColumn from xxx where……",new SqlConnection(……))
{
cmd.Connection.Open();
DateTime dt = DateTime.Parse(cmd.ExecuteScalar());
if((DateTime.Now - dt).Minutes>XX) //如果超过了多少分钟,刷新一次页面
{
//做你想做的……
}
}
}
如果你有其它意见或私下交流,请直接发送maledong_work@foxmail.com;或者
If you do not have QQ, please open the page and download it and click the image to talk or leave message for me.
下载MSDN桌面工具(Vista,Win7)
下载Technet桌面小工具(Vista,Win7)
慈善点击,点击此处- 已标记为答案 Song TianModerator 2011年8月17日 11:49
全部回复
-
quest:
在页面中建了一个列表 。如果A用户 在打开页面后 B 用户也打开了 ,并在A用户打开后将列表中做过改动。A看到的还B未改动的页面 。用什么方法解决这个问题捏。。。 求解
页面中我用GRIDVIEW 做的 谢谢
Html自身不会改变的,唯一的办法就是设法定时刷新<html><head><title>我自己的网页</title><meta http-equiv="refresh"content=5 url="xxx.aspx"></head></html>
如果你有其它意见或私下交流,请直接发送maledong_work@foxmail.com;或者
If you do not have QQ, please open the page and download it and click the image to talk or leave message for me.
下载MSDN桌面工具(Vista,Win7)
下载Technet桌面小工具(Vista,Win7)
慈善点击,点击此处 -
在数据库里新增一个时间的时段 当用户读取这个字段的时候同时也读取了时间这个字段 然后 操作时做个时间的比较……
在Page_Load中:if(!IsPostBack)
{
using (SqlCommand cmd = new SqlCommand("select top 1 DataTimeColumn from xxx where……",new SqlConnection(……))
{
cmd.Connection.Open();
DateTime dt = DateTime.Parse(cmd.ExecuteScalar());
if((DateTime.Now - dt).Minutes>XX) //如果超过了多少分钟,刷新一次页面
{
//做你想做的……
}
}
}
如果你有其它意见或私下交流,请直接发送maledong_work@foxmail.com;或者
If you do not have QQ, please open the page and download it and click the image to talk or leave message for me.
下载MSDN桌面工具(Vista,Win7)
下载Technet桌面小工具(Vista,Win7)
慈善点击,点击此处- 已标记为答案 Song TianModerator 2011年8月17日 11:49