/// <summary> /// Shows how to get all records based on Search Parameters. /// </summary> private void SelectAllDynamicWhere() { // search parameters, everything is nullable, only items being searched for should be filled // note: fields with String type uses a LIKE search, everything else uses an exact match // also, every field you're searching for uses the AND operator // e.g. int? productID = 1; string productName = "ch"; // will translate to: SELECT....WHERE productID = 1 AND productName LIKE '%ch%' int? enrollmentId = null; int? courseName = null; int? studentName = null; string comments = null; List <CourseEnrollment> objCourseEnrollmentCol = CourseEnrollment.SelectAllDynamicWhere(enrollmentId, courseName, studentName, comments); }