Whats wrong wrong with this query please correct me on this syntactcally it's going wrong please correct me on this how to concatenate this
string cmd = "SELECT *
FROM [tbl_students]
WHERE course_id=@courseId
AND branch_id IN ("+branchId+")
AND (@passoutYear is null or passout_year>=@passoutYear)
AND (@currentBacklog is null or current_backlog<=@currentBacklog)
AND gender=@sex
AND (@eGap is null or gapin_education<=@egap)
AND (@firstYrPercent is null or first_yea_percent>=@firstYrPercent
AND (@secondYrpercent is null or second_year_percent>=@secondYrPercent)
AND (@thirdYrPercent is null or third_year_percent>=@thirdYrPercent)
AND (@finalYrpercent is null or final_year_percent>=@finalYrpercent)
AND (@currentDegreePercentage is null current_degree_percent>=@currentDegreePercentage)
AND (@highSchoolPercentage is null high_school_percentage>=@highSchoolPercentage)
AND (@higherSchoolPercentage is null higher_school_percentage>=@higherSchoolPercentage)
AND (@graduationPercent is null graduation_percent>=@graduationPercentage)
AND (@diplomaPercentage is null diploma_percentage>=@diplomaPercenage)
AND (@noOfAtkt is null or no_of_atkt<=@noOfAtkt)
AND (@date is null or date_of_birth>=@date)";