以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  希望CreateTree能支持临时表,或者查询表  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=24001)

--  作者:zoomify
--  发布时间:2012/9/26 16:02:00
--  希望CreateTree能支持临时表,或者查询表

CreateTree(DataTableName, ColumnName, Separator,Filter,sort)

是用来自动建立一个树,但往往DataTableName的数据不符合要求,需要整理下,这样如果CreateTree能支持临时表,或者查询表,就很好了.

 

Dim tr  As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim tbl As WinForm.Table

tbl = e.Form.CreateSQLQuery("Table1", "Select * From {某列}","")
tr.CreateTree("Table1", "序号",".")


--  作者:zoomify
--  发布时间:2012/9/26 16:15:00
--  

Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")

Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.CommandText = "Select * From {***}"
dt = cmd.ExecuteReader()

\'trv.BuildDataTree(dt, ".","序号")
trv.CreateTree(dt,"序号",".")

 

原来是可以的,用SQLCommand