老师好。下面的代码,我希望按照时间区间加载数据。在外部数据表中,datatables(name)我设定加载50行。但是执行下面代码后实际运行结果还是50行,没有按照时间区间加载。请您指点。谢谢!
Dim dtb1 As DataTable = DataTables (name)
Dim name_rq As String = e.Form.Controls("Combo日期列").Value
Dim date1 As Date = e.Form.Controls("DateTimePicker1").Value
Dim date2 As Date = e.Form.Controls("DateTimePicker2").Value
Dim filter As String = name_rq & ">= '" & date1 & "' And " & name_rq & " <= '" & date2 & "'"
Tables (e.Form.Name & "_table1").DataSource = dtb1
Tables (e.Form.Name & "_table1").DataTable.LoadFilter = filter
Tables (e.Form.Name & "_table1").DataTable.Load