Ticket T395653
Visible to All Users

"A custom SQL query should contain only SELECT statements" when moving from 15.1.4 to 15.1.11

created 9 years ago

I recently migrated from 15.1.4 to 15.1.11.  When we do a CreateDocument(), we get the following error message:
"A custom SQL query should contain only SELECT statements".  I need to turn off this validation.  Can you please tell me how to disable this validation and execute the query anyway?

Thanks,
Thomas

Answers approved by DevExpress Support

created 9 years ago (modified 9 years ago)

Hello,
To achieve the required result, I suggest you use the SqlDataSource.DisableCustomQueryValidation property. In this case, you can disable query validation completely. I suggest you also review the Database Security and How to: Provide Custom Query Validation help topics for more details.
Please let me know if this information is helpful.

    Comments (2)

      How do you set the SqlDataSource.DisableCustomQueryValidation  property?

      I can't see anything in the designer either at runtime or design time.

      Dmitry Tokmachev (DevExpress) 8 years ago

        Hi Mike,

        This is a static property of the SqlDataSource class, so it can be set once, for example, at the application startup:

        C#
        SqlDataSource.DisableCustomQueryValidation = true;

        Does this help?

        Thanks

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.