Dim i As new SQLCommand i.Connection Name = "数据源名称" i.CommandText ="select Count(*) from {wl请购单} where 请购日期 = '" & Date.today & "'" If i.ExecuteScalar >0 Then DataTables("wl请购单").loadfilter ="请购日期 ='" & Date.today & "'" DataTables("wl请购单").load Else messagebox.show("对不起今天还没数据") End If