Ticket T152725
Visible to All Users

CriteriaToWhereClauseHelper.GetDataSetWhere returns a string that contains the displayname instead of the database name

created 10 years ago

[DevExpress Support Team: CLONED FROM K18434: How to convert the CriteriaOperator to the corresponding filter string in order to use it for building SQL queries or for filtering the DataView]
This is a really cool function but i have one problem.
When i convert to a sql-String, the string will contain the displayname instead of the database name , any idea ?
Thanks

Answers approved by DevExpress Support

created 10 years ago

Hello Chris,

Neither the CriteriaToWhereClauseHelper.GetDataSetWhere method nor the CriteriaOperator object contains information about display names specified in the business class or in a control. So, the issue is likely in data passed to the CriteriaOperator. It likely contains display names instead of property names. Ensure that you are obtaining or building this CriteriaOperator correctly. If you cannot find the reason, please provide a sample project reproducing the issue.

    Comments (2)

      So, whata do i do :
      I have a grid, bound to a xpcollection. Grid will show Displayname of course.
      Now i use this code:
      Dim op As CriteriaOperator = GridView1.ActiveFilterCriteria
      Dim filterString As String = DevExpress.Data.Filtering.CriteriaToWhereClauseHelper.GetMsSqlWhere(op)
      And the filterstring will contains Displaynames instead of datafields.
      That´s all, i don not need to make an example for it, right ? :-)

      Anatol (DevExpress) 10 years ago

        Probably the CriteriaOperator is passed to the grid control in a specific manner. I have not managed to reproduce the issue with filters that can be created in the user interface. See my test project in the attachment.

        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.