以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]能否直接对数据表进行排序  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=126207)

--  作者:2900819580
--  发布时间:2018/10/16 14:48:00
--  [求助]能否直接对数据表进行排序
Dim cmd As new SQLCommand
Dim Sqldt As DataTable
cmd.C
cmd.CommandText = "Sel ect FNumber As 代码,FName As 名称,FLevel as 层次 from {t_Item} where [FItemClassID] = \'2001\'"
Sqldt = cmd.ExecuteReader

Dim tb As Table 
tb.DataSource = sqldt
tb.Sort = "代码"


老师,能否直接对生产的数据表SQldt进行排序,而不用下面这三行红色代码!

--  作者:有点甜
--  发布时间:2018/10/16 15:02:00
--  

试试

 

cmd.CommandText = "Sel ect FNumber As 代码,FName As 名称,FLevel as 层次 from {t_Item} where [FItemClassID] = \'2001\' order by 代码"