里面的查询语句dim cmd=new sqlcommand("select * from yield where date='"+ d1 +"',cn),改成这样应该就可以了
成都创新互联长期为上千多家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为保亭黎族企业提供专业的做网站、网站设计,保亭黎族网站改版等技术服务。拥有十载丰富建站经验和众多成功案例,为您定制开发。
dim 现在的时间 as date = Now
"Select * From 表 Where 开始的时间= # " 现在的时间 "# And 结束的时间= # " 现在的时间 " # "
Dim ThisDay As String = Format(Now, "yyyy-MM-dd") '获得当前日期字符串
Dim ThisDateTime As DateTime = Convert.ToDateTime(ThisDay) '当前日期转换成DateTime
Dim ThisWeekDay As Integer = ThisDateTime.DayOfWeek '获得当前日期是星期几
Dim differadd As Integer = 1 - ThisWeekDay '相差的天数(星期1与当前星期几相差的天数)
Dim MyAdd As New TimeSpan(differadd, 0, 0, 0)
Dim MyYear As Integer = Format(Now, "yyyy") '获取当前日期的年份
Dim MyMonth As Integer = Format(Now, "MM") '获取当前日期的月份
Dim MyDay As Integer = Format(Now, "dd") '获取当前日期是几号
Dim MyToday As DateTime = New DateTime(MyYear, MyMonth, MyDay)
Dim Yourday As DateTime = MyToday.Add(MyAdd)
MsgBox("本周星期一的日期是:" Yourday)
Dim dt as Date
Dim s="2009-12-32"
if NOT Date.TryPhrase(s,dt) then
'日期无效代码
end if