Change if condition in following way.
if (txtemp.Text != "")
{
search = search + " and EMP_ID = '" + txtemp.Text + "'";
}
if (date1 != "" & date2 != "")
{
search = search + " and Date between '" + date1 + "' and '" + date2 + "'";
}
if (txtdept.Text != "")
{
search = search + " and SELLER_DEP = '" + txtdept.Text + "'";
}