用System.Timers.Timer定时获取数据库的变化,如果有符合条件的变化则刷新页面数据,怎么写?
在aTimer.Elapsed += new ElapsedEventHandler(TimeEvent);里面写
        public void TimeEvent(object source, ElapsedEventArgs e)
        {
            string sql = "select top 1 content,rolling,row_id from text where ison=1";
            DataView dv = dbh.Executedv(sql);
            if (dv.Count == 1 && dv != null)
            {
                if (dv[0]["content"].ToString() != content)
                    System.Web.HttpContext.Current.Response.Write("<script>window.location.reload();</script>");
            }
        }
报错Response.Write未将对象引用设置到对象的实例。