天天看点

kentico中提示Message: An invalid SQL query was used.

在调用CMSAbstractWebPart类的GetValue方法的时候出错。

namespace CMS.PortalEngine.Web.UI

{

/// <summary>

/// Base class for the web part controls.

/// </summary>

[DebuggerDisplay("CMSAbstractWebPart({WebPartID})")]

public abstract partial class CMSAbstractWebPart : AbstractUserControl, ICMSVariantsControl, ITimeZoneManager, IDataControl, ISimpleDataContainer, IExceptionHandler

/// Returns the value of the given web part property property.

/// <param name="propertyName">Property name</param>

public virtual object GetValue(string propertyName)

return GetValueInternal(propertyName, true);

}

https://devnet.kentico.com/questions/invalid-sql-query-error-on-a-page

Go to settings -> System -> Debug and enable SQL query debug.

kentico中提示Message: An invalid SQL query was used.

Now go to Debug -> SQL queries tab and now you will be able to see detail error log for SQL

Remember to check "Show complete context"

kentico中提示Message: An invalid SQL query was used.

最后发现是一个名为orderby的property存储了非法字符&