string search = "SELECT Id,Category,Subject,Date FROM News "; if (txtdate1.Text != "" && txtdate2.Text != "") { search = search + "Where Date between '" + date1 + "' and '" + date2 + "'"; } else if (txtdate1.Text != "" && txtdate2.Text == "") { search = search + "Where Date = '" + date1 + "'"; } else if (txtdate2.Text != "") { search = search + "Where Date = '" + date2 + "'"; } cmd.CommandText = search; DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds); gvImages.DataSource = ds; gvImages.DataBind();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)