以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]Fill加载会出现集合已修改;可能无法执行枚举操作的问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=175850)

--  作者:2900819580
--  发布时间:2022/3/21 20:31:00
--  [求助]Fill加载会出现集合已修改;可能无法执行枚举操作的问题
.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2022.1.30.2
错误所在事件:
详细错误信息:
集合已修改;可能无法执行枚举操作。


Dim fi As String
If e.Form.Controls("VTextfi").text > "" Then
    Fi = "sele ct * from {" & e.Form.Controls("Txt数据视图").text & "} where fid = 1 And " & e.Form.Controls("VTextfi").text
Else
    Fi = "sel ect * from {" & e.Form.Controls("Txt数据视图").text & "} where Itid is not null and Fid = 1"
End If
Dim tb As Table = Tables(e.Form.Name & "_Table1")
tb.Fill(fi,"Zc_Data",True)

以上红色这行有问题, 用以下蓝色代码代替没有问题。但用下面的蓝色的代码又怕会出现这样的问题 http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=175109&skin=0
Dim cmd As new SQLCommand
cmd.C
cmd.Comma ndText = Fi
tb.DataSource = cmd.ExecuteReader


--  作者:有点蓝
--  发布时间:2022/3/21 20:50:00
--  
试试

SystemReady = False
tb.Fill(fi,"Zc_Data",True)
SystemReady = True