-2
안녕하세요 친구가 내 쿼리 where displaylist 경우 개체가 stringBuilder가 길이가 0 인 경우가 있지만 그 경우 잘못된 구문을 FROM 근처에 제공합니다. 어떻게이 문제를 피할 수 있습니까? 다른 형태로 이러한 문제가 발생하지 않도록 또는 뷰sql 쿼리 및 asp.net
string cmd = @"SELECT [tbl_course].course_name as Course_Name , [tbl_branch].branch_name as Branch_Name,"[email protected]" FROM [tbl_students], [tbl_course], [tbl_branch]
WHERE [tbl_students].course_id= @courseId
AND [tbl_students].branch_id IN(" + branchId + @")
AND (@firstYrPercent is null OR[tbl_students].first_year_percent>[email protected])
AND (@secondYrpercent is null OR[tbl_students].second_year_percent>[email protected])
AND (@thirdYrPercent is null OR[tbl_students].third_year_percent>[email protected])
AND (@finalYearpercent is null OR[tbl_students].final_year_percent>[email protected])
AND (@currentDegeePercentage is null OR[tbl_students].current_degree_percent>[email protected])
AND (@passoutYear is null OR[tbl_students].passing_year>[email protected])
AND (@currentBacklog is null OR[tbl_students].current_backlog<[email protected])
AND [tbl_students][email protected]
AND (@eGap is null OR [tbl_students].gapin_education<[email protected])
AND (@highSchoolPercentge is null OR[tbl_students].highschool_percentage>[email protected])
AND (@higherSchoolPercentage is null OR[tbl_students].ssc_percentage>[email protected])
AND (@grauationPercentage is null OR[tbl_students].graduation_percentage>[email protected])
AND (@diplomaPercentage is null OR[tbl_students].diploma_percentage>[email protected])
AND (@noOfAtkt is null OR[tbl_students].number_of_ATKT<[email protected])
AND (@validDate is null OR[tbl_students].DOB<[email protected])
AND [tbl_students].branch_i
d=[tbl_branch].branch_id AND [tbl_students].course_id=[tbl_course].course_id";
전 길이가 0 인 경우 표시를 짧게하고 싶습니다. – NoviceToDotNet
"."에 대해 들어 보셨습니까? – Eiko