Foxtable(狐表)用户栏目专家坐堂 → 数据源设置


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

主题:数据源设置

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


加好友 发短信
等级:版主 帖子:5246 积分:33163 威望:0 精华:8 注册:2013/1/17 21:28:00
  发帖心情 Post By:2014/4/22 16:03:00 [显示全部帖子]

改一下试试:

窗口表用SQLTable或SQLQuery

不用Fill,用DataSource

 

或者改下代码:

 

s = "Select 房间号," & s.trim(",") & " from {客房信息表}"

 

改成

s = "Select '' As 房间号," & s.trim(",") 

[此贴子已经被作者于2014-4-22 16:07:29编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
lsy
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:5246 积分:33163 威望:0 精华:8 注册:2013/1/17 21:28:00
  发帖心情 Post By:2014/4/22 17:12:00 [显示全部帖子]

找到原因了:

 

Dim mon As String = CLNum(Date.Today.Month)
Dim days As Integer = Date.DaysInMonth(Date.Today.Year,Date.Today.Month)
Dim s As String
For j As Integer = 1 To days
    s + = "'' As " & mon & "月" & j & "日,"
Next
s = "Select '' As 房间号," & s.trim(",")
DataTables("窗口1_Table1").Fill(s,"tzzt",True)

 

或者:

Dim mon As String = CLNum(Date.Today.Month)
Dim days As Integer = Date.DaysInMonth(Date.Today.Year,Date.Today.Month)
Dim s As String
For j As Integer = 1 To days
    s + = "'' As " & mon & "月" & j & "日,"
Next
s = "Select '' As 房间号," & s.trim(",")
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText = s
Tables("窗口1_Table1").DataSource = cmd.ExecuteReader


 回到顶部
帅哥哟,离线,有人找我吗?
lsy
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:5246 积分:33163 威望:0 精华:8 注册:2013/1/17 21:28:00
  发帖心情 Post By:2014/4/24 6:31:00 [显示全部帖子]

Dim mon As String = MonthName(Date.Today.Month) '或者 Dim mon As String = Format((Date.Today,"MMM")
Dim days As Integer = Date.DaysInMonth(Date.Today.Year,Date.Today.Month)
Dim s As String
For j As Integer = 1 To days
    s + = "'' As " & mon & j & "日,"
Next
s = "Select '' As 房间号," & s.trim(",")
DataTables("窗口1_Table1").Fill(s,"tzzt",True)

 回到顶部