老师好。下面的两组代码,哪个更高效些?
第一组:
dim bh as string =e.row("编号")
for each dr as row in tables("表A").rows
if dr("编号")=bh then
dr.checked = true
end if
next
第二组:
dim bh as string =e.row("编号")
dim drs as list(of datarow) =datatables("表A").select("[编号]='" & bh & "'")
for each dr as datarow in drs
dim index as integer = tables("表A").findrow(dr)
tables("表A").rows(index).checked = true
next
[此贴子已经被作者于2020/2/26 3:07:47编辑过]