以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]怎么按自定义字段排序  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=127981)

--  作者:YOU
--  发布时间:2018/11/26 15:59:00
--  [求助]怎么按自定义字段排序
怎么按自定义字段排序
Dim cmd As New SQ LCommand
        cmd.C
        cmd.CommandText = "sel ect a.uid,a.kjid,a.CoursewareTitle,a.CoursewarePicture,a.lecturer,b.自定义排序,b.点播次数,b.是否启用 Fr om 详细课件 a,学员权限设置 b WHERE a.uid =b.[课件ID] And b.openid =\'" & e.Cookies("openid") & "\' And 是否启用 =\'" & TrueA & "\'"
        Dim yhm As DataTable = cmd.ExecuteReader()
        Dim drsa As List(Of DataRow) = yhm.Sel ect("","自定义排序")
        For Each adra As DataRow In drsa
            With .Add("pn" & adra("uid"),adra("CoursewareTitle"),"讲师: " & adra("lecturer") &"","./image/" & adra("CoursewarePicture"),"OnlineVideo.htm?page=" & adra("uid") & "&id=" & adra("kjid"))
                .AddFoot("学习次数: " & adra("点播次数") & "次")
            End With
        Next

--  作者:YOU
--  发布时间:2018/11/26 17:13:00
--  
求助
--  作者:有点蓝
--  发布时间:2018/11/26 17:13:00
--  
试试
For i as integer = 0 to drsa.count - 1
dim adra As DataRow = drsa(i)
            With .Add("pn" & adra("uid"),adra("CoursewareTitle"),"讲师: " & adra("lecturer") &"","./image/" & adra("CoursewarePicture"),"OnlineVideo.htm?page=" & adra("uid") & "&id=" & adra("kjid"))
……

如果还不行,就是您的自定义排序值有问题