/// <summary> /// Gets the SQL predicate statement. /// </summary> /// <returns></returns> public string GetSqlPredicateStatement(IConnectionInfo connectionInfo) { if ((this.Predicate != SelectPredicate.Distinct) && (this.PredicateParameter == 0)) { throw new InvalidOperationException("Cannot generate TOP or TOP_PERCENT predicate without specifying an integer parameter!"); } if (Predicate == SelectPredicate.Top) { return(connectionInfo.GetPredicateTop(PredicateParameter.ToString())); } else { return("DISTINCT"); } }