以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]关于list  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=100367)

--  作者:371202
--  发布时间:2017/5/10 14:20:00
--  [求助]关于list

哪位老师帮忙看一下,在DatacolCHanged写入

Dim Filter As String = "编码=" & e.DataRow("编码")
Dim drs As List(of DataRow)=DataTables("表A").Select(Filter)
Messagebox.show(drs.count)

 

编码列数据                        

1
12
123
1234
12345
123456
1234567
12345678
123456789
1234567890
12345678901
123456789012
1234567890123
18345678901234
运行后,更改不同行,运行结果不一样,有1、0和报错三种情况,不知道为什么,请老师指点一下

[此贴子已经被作者于2017/5/10 14:37:30编辑过]

--  作者:有点蓝
--  发布时间:2017/5/10 14:58:00
--  
如果是字符列,加上单引号

If e.DataCol.Name = "编码"
    Dim Filter As String = "编码=\'" & e.DataRow("编码") & "\'"
    Dim drs As List(of DataRow)=DataTables("表A").Select(Filter)
    Messagebox.show(drs.count)
End If


--  作者:371202
--  发布时间:2017/5/10 15:31:00
--  

非常感谢,解决大问题了,纳闷了一天了