web数据源关联表afterload加载,经测试load导致程序退出
If e.DataTable.DataRows.Count > 0 Then
Dim ids As String
Dim idcards As String
For Each dr As DataRow In DataTables("Person_info").DataRows
ids = ids & "," & dr("bmID")
idcards = idcards & "," & dr("papernum")
Next
ids= ids.Trim(",")
idcards= idcards.Trim(",")
e.DataTable.LoadChildren("Train_info","bmID","[bmID]") ‘此代码可行
DataTables("Train_info").LoadFilter = "bmID In (" & ids & ")" '此代码导致程序异常退出
DataTables("Train_info").Load() '此代码导致程序异常退出
End If
但是我再另外一个程序,主表是直连数据库
用的是CurrentChanged代码加载web数据源,程序不报错
DataTables("Person_info").LoadFilter = ("enterprise_id = '"& e.Table.current("enterprise_id") &"' ")
DataTables("Person_info").Load()