string strSQL = string.Empty; if(DropDownList1.SelectedValue == "true") strSQL = "select * from tablename where checkstate=1"; else if(DropDownList1.SelectedValue == "false") strSQL = "select * from tablename where checkstate=0"; else if(DropDownList1.SelectedValue == "all") strSQL = "select * from tablename";