下午好,用户应该能够同时按日期和文本搜索,我如何在一个文本框中同时进行搜索?
protected void BtnWinnersSearch_Click(object sender, EventArgs e)
{
string searchText = txtWinnersSearch.Text.Replace("'", "''").Trim();
GridViewWinners.Visible = true;
SqlDataSource4.FilterExpression = "nickname like '%" + searchText + "%' or username like '%" + searchText +
"%' or clubnumber like '%" + searchText + "%' or firstname like '%" +
searchText + "%' or lastname like '%" + searchText +
"%' or email like '%" + searchText + "%' or dob like '%" + Convert.ToDateTime(searchText).ToString("yyyy-MM-dd") + "%'";
}
引发以下错误:
作品!