821版,SQL动态加载出现如下问题:
此主题相关图片如下:qq截图未命名.jpg
出库主表代码说明:
窗口
AfterLoad代码如下:
Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.C
cmd.CommandText = "SELECT DISTINCT 省市,客户名称 From 出库主表"
dt = cmd.ExecuteReader()
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildDataTree(dt, "","省市","客户名称")
目录树的
NodeMouseDoubleClick代码如下:
Dim Value()As String
Dim Filter As string
Value = e.Node.FullPath.Split("\")
Select Case e.Node.Level
Case 0
Filter ="[省市] = '" & Value(0) & "'"
Case 1
Filter ="[省市] = '" & Value(0) & "' And [客户名称] = '" & Value(1) & "'"
End Select
DataTables("出库主表").LoadFilter = Filter
DataTables("出库主表").Load()
Dim dst As WinForm.DataList = e.Form.Controls("DataList1")
dst.DataTable = DataTables("出库主表")
dst.Build()项目
BeforeLoadOuterTable动态加载的代码:
If e.DataTableName = "出库主表" AndAlso e.User.Name = "开发者" Then
e.SelectString = "Select * From 出库主表 Where ID < 0"
End If
If e.DataTableName = "出库明细" AndAlso e.User.Name = "开发者" Then
e.SelectString = "Select * From 出库明细 Where ID < 0"
End If
窗口中的目录树不能加载
此主题相关图片如下:qq截图未命名2.jpg
别的问题,将
Dim Filter As String
改为
Dim Filter As String = ""
然后就可以看出真正的问题来
以下是引用狐狸爸爸在2009-8-22 13:42:00的发言:
别的问题,将
Dim Filter As String
改为
Dim Filter As String = ""
然后就可以看出真正的问题来
还是值得学习的,呵呵