数据类型转换
我在数据库中,TIME 定义的是string类型。
private void Search(string comboBox1,string dateTimePicker1,string dateTimePicker2,string comboBox22,string comboBox33,string comboBox44)
{
string SQL="Select *from people where TIME between'" + dateTimePicker1 + "'and'" + dateTimePicker2 + "'";
case "查询":
this.Search(this.comboBox1.SelectedText, this.dateTimePicker1.Value.ToShortDateString(),
this.dateTimePicker2.Value.AddDays(1).ToShortDateString, this.comboBox22.SelectedText,
this.comboBox33.SelectedText, this.comboBox44.SelectedText);
break;
报错了,好像是数据类型转换不过来,SQL语言怎么该?
[解决办法]
ToShortDateString()
[解决办法]