Foxtable(狐表)用户栏目专家坐堂 → 获取多个表 月份,代码出错,请各位高手帮我看一下,是哪里出错了?


  共有9423人关注过本帖树形打印复制链接

主题:获取多个表 月份,代码出错,请各位高手帮我看一下,是哪里出错了?

帅哥哟,离线,有人找我吗?
lin_hailun
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:6708 积分:34304 威望:0 精华:11 注册:2012/8/18 23:10:00
  发帖心情 Post By:2012/10/9 16:49:00 [显示全部帖子]

 这个代码,写起来也挺麻烦的。

Dim months As New List(Of String)
For Each dt As DataTable In DataTables
    If dt.Name.Contains("明细") Then
        If dt.DataCols.Contains("月份") Then
            For Each month As String In dt.GetUniqueValues("", "月份")
                If months.Contains(month) = False Then
                    months.Add(month)
                    If months.Count >= 12 Then Exit For
                End If
            Next
            If months.Count >= 12 Then Exit For
        End If
    End If
Next

Dim strMonth As String = ""
For Each month As String In months
    strMonth = strMonth & month & "|"
Next
strMonth.Trim("|")

cmb.ComboList = strMonth

 回到顶部