为什么这样写? string mySearch="select * from table where StartDate like '%"+ DateTime.Parse(txtStartDate.Text.Trim())+"%'"; 这样写不行吗? string mySearch="select * from table where StartDate like '%"+ txtStartDate.Text.Trim()+"%'";当然你的txtStartDate.Text应该是2004-10-12
取的还是有00:00:00
还有没有其他的方法啊
用replace(string,"00:00:00","")这种方法行吗?
具体该怎么写呢
string mySearch="select * from table where StartDate like '%"+ DateTime.Parse(txtStartDate.Text.Trim())+"%'";
这样写不行吗?
string mySearch="select * from table where StartDate like '%"+ txtStartDate.Text.Trim()+"%'";当然你的txtStartDate.Text应该是2004-10-12
DataTime dt = DateTime.Now.Date;//获取实例的日期部分