Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.C
cmd.CommandText = "SELECT GY_LZFS.FSMC, CP_CK01.SHSJ, CP_CPZD.CPBM, CP_CPZD.CPMC, CP_CPZD.CPGG, CP_CPZD.CPYS, CP_CPZD.CPDW, CP_CK02.DHDH, CP_CK02.CPSL, CP_CK02.JSJG, CP_CK02.JSJE, CP_JGXX.XSJG, CP_CK02.DHDH" _
& " FROM ((GY_LZFS INNER JOIN (CP_CK01 INNER JOIN CP_CK02 ON (CP_CK01.LZDH = CP_CK02.LZDH) And (CP_CK01.LZFS = CP_CK02.LZFS)) ON GY_LZFS.LZFS = CP_CK01.LZFS) INNER JOIN CP_CPZD ON CP_CK02.CPXH = CP_CPZD.CPXH) INNER JOIN CP_JGXX ON CP_CK02.CPXH = CP_JGXX.CPXH" _
& " WHERE (((GY_LZFS.FSMC)='销售出库') AND ((CP_JGXX.XSLX)=2) AND ((CP_CK01.DJZT)='AU'));"
dt = cmd.ExecuteReader()
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree(dt,"SHSJ YM")
trv.Nodes.Insert("加载所有数据",0)
在窗体的afterload事件,加入上述代码,想按时间来显示,结果老提示 无效列名 SHSJ YM ,改成 trv.BuildTree(dt,"SHSJ") 这样不会提示,但是我要按月显示树,问题在哪里?