XPO - Important Changes to Default Query Parameter Validation (v20.1)

XPO Team Blog
21 May 2020


We recently documented the following changes in v20.1.3:

Unfortunately, we failed to anticipate the scope of query parameter inconsistencies within customer apps (EAP/Beta feedback did not uncover this issue). Despite benefits associated with our changes, we do not want to force XPO users to modify their code immediately or revert to previous behavior manually (with feature toggles).


We softened default parameter validation with regard to SELECT, UPDATE, and INSERT statements in our v20.1.4 release.
We introduced a new DevExpress.Xpo.DB.QueryParameterMode enumeration with the following values:

  • Legacy: for v19.2 and older versions.
  • SetType (Default): will only validate parameter type without size. Will preserve all performance optimizations. SetType will still catch errors such as Guid parameter comparisons with strings (learn more).
  • SetTypeAndSize: will validate type and size. It will be automatically set for MSSqlConnectionProvider and Always Encrypted).

You can set the ConnectionProviderSql.QueryParameterMode property or the ConnectionProviderSql.GlobalQueryParameterMode static property as needed. Example:

using DevExpress.Xpo.DB;
ConnectionProviderSql.GlobalQueryParameterMode = QueryParameterMode.Legacy;

The majority of XPO users will not need to modify this behavior, because new defaults should address most requirements.


Please test a new build and let us know how this solution works for you.

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.