以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  狐表数据刷新问题  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=178091)

--  作者:ycs5801
--  发布时间:2022/6/17 15:50:00
--  狐表数据刷新问题

以下内容是专门发给有点蓝浏览



我点击生成结果后,在狐表的表内数据因为没刷新成最新数据,造成计算结果不准确,请问怎么能提前刷新一下表内数据,再计算。另外,我这个软件的思路我觉得很一般,是通过事件触发计算很多数据,请问有没有更合理的计算方式,我这里计算的东西太多了。

--  作者:ycs5801
--  发布时间:2022/6/17 15:51:00
--  
附件2
图片点击可在新窗口打开查看此主题相关图片如下:112.png
图片点击可在新窗口打开查看

--  作者:ycs5801
--  发布时间:2022/6/17 15:55:00
--  
附件传不上来呢
--  作者:有点蓝
--  发布时间:2022/6/17 16:11:00
--  
是指网页数据保存了,客户端表格数据没有刷新?客户端重新加载数据参考:http://www.foxtable.com/webhelp/topics/1928.htm
--  作者:ycs5801
--  发布时间:2022/6/18 11:02:00
--  

比如这个:

 Dim pr As DataRow = DataTables("操作表").sqlFind("[_Identify]=" & PrimaryKey)
    If pr IsNot Nothing Then
        DataTables("操作表").Load()

 

我是想找到pr这行之后,先刷新一下pr这行的数据,再进行调取计算,不然数据不准确。现在是用的DataTables("操作表").Load() 将整个表刷新了,这种是不是效率低?如果只同步更新这一行,该怎么写?


--  作者:ycs5801
--  发布时间:2022/6/18 11:02:00
--  

比如这个:

 Dim pr As DataRow = DataTables("操作表").sql Find("[_Identify]=" & PrimaryKey)
    If pr IsNot Nothing Then
        DataTables("操作表").Load()

 

我是想找到pr这行之后,先刷新一下pr这行的数据,再进行调取计算,不然数据不准确。现在是用的DataTables("操作表").Load() 将整个表刷新了,这种是不是效率低?如果只同步更新这一行,该怎么写?


--  作者:有点蓝
--  发布时间:2022/6/18 11:15:00
--  
追加数据:http://www.foxtable.com/webhelp/topics/2276.htm

Dim pr As DataRow = DataTables("操作表").Find("[_Identify]=" & PrimaryKey)
    If pr IsNot Nothing Then
        pr.Load()
else
DataTables("操作表").appendload("[_Identify]=" & PrimaryKey)
endif

--  作者:ycs5801
--  发布时间:2022/6/18 13:20:00
--  
这样判断,如果后台没找到这条数据怎么办?
--  作者:有点蓝
--  发布时间:2022/6/18 13:58:00
--  
那也不会有什么影响
--  作者:ycs5801
--  发布时间:2022/6/18 18:08:00
--  
 Dim houtair As DataRow = DataTables("操作表").sqlFind("[_Identify]=" & PrimaryKey)
    If houtair IsNot Nothing Then
        Dim pr As DataRow = DataTables("操作表").Find("[_Identify]=" & PrimaryKey)
        If pr IsNot Nothing Then
            pr.Load()
        Else
            DataTables("操作表").appendload("[_Identify]=" & PrimaryKey)
        End if
else 
message...该行数据已删除

我这样先判断一下后台,有没有必要,可以不?