以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 类同的代码合并 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=169661) |
||||
-- 作者:g1j2h3 -- 发布时间:2021/6/24 23:00:00 -- 类同的代码合并 求助老师,文档中有几段类同的代码,能否合并一下,简单写出来
|
||||
-- 作者:有点蓝 -- 发布时间:2021/6/24 23:38:00 -- Dim cmd As New SQLCommand Dim dt As DataTable cmd.C cmd.CommandText = "Select Distinct Year(接单日期) As 年, Month(接单日期) As 月, Day(接单日期) As 日 From {销售订单}" dt = cmd.ExecuteReader() Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1") trv.BuildTree(dt, "年|月|日","年 > 2020") Dim trv1 As WinForm.TreeView = e.Form.Controls("TreeView2") trv1.BuildTree(dt, "年|月|日","年 > 2020") cmd.CommandText = "Select Distinct Year(申请日期) As 年, Month(申请日期) As 月, Day(申请日期) As 日 From {外协产品申请}" dt2 = cmd.ExecuteReader() Dim trv2 As WinForm.TreeView = e.Form.Controls("TreeView3") trv2.BuildTree(dt2, "年|月|日","年 > 2020") Dim trv3 As WinForm.TreeView = e.Form.Controls("TreeView4") trv3.BuildTree(dt2, "年|月|日","年 > 2020")
|
||||
-- 作者:g1j2h3 -- 发布时间:2021/6/25 0:06:00 -- 谢谢老师 |
||||
-- 作者:g1j2h3 -- 发布时间:2021/6/25 19:00:00 -- 提示错误 此主题相关图片如下:4c2bddc33970e6e192219816e02633b.png |
||||
-- 作者:有点蓝 -- 发布时间:2021/6/26 8:59:00 -- cmd.ConnectionName = "数据源名称" 代码被网站屏蔽了,自己补充完整
|