在关键字 'and' 附近有语法错误
代码如下,是用于按时间进行查询的语句,不知道是哪里出错了,请指正,还在学习中,谢谢了。stringQueryString="";QueryString="and[date...
代码如下,是用于按时间进行查询的语句,不知道是哪里出错了,请指正,还在学习中,谢谢了。
string QueryString = "";
QueryString = " and [date]>='" + DropDownCalendar1.Value.ToShortDateString() + " 0:0:0' and [date]<='"
+ DropDownCalendar1.Value.ToShortDateString() + " 23:59:59'";
SqlDataSource1.SelectCommand = "SELECT * FROM [car] WHERE carId=" + Request.QueryString["carId"] + QueryString;
ViewState["carSelectCommand"] = SqlDataSource1.SelectCommand;
GridView1.DataBind(); 展开
string QueryString = "";
QueryString = " and [date]>='" + DropDownCalendar1.Value.ToShortDateString() + " 0:0:0' and [date]<='"
+ DropDownCalendar1.Value.ToShortDateString() + " 23:59:59'";
SqlDataSource1.SelectCommand = "SELECT * FROM [car] WHERE carId=" + Request.QueryString["carId"] + QueryString;
ViewState["carSelectCommand"] = SqlDataSource1.SelectCommand;
GridView1.DataBind(); 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询