Ticket T737259
Visible to All Users

Listview shows as empty when there is a long column name in the model

created 6 years ago (modified 6 years ago)

I have records in my table but my xaf listview is empty.
I have identified that the problem is in my model because if I remove this field from the model then I see the records
public bool ExcludeFromPrioritizeByDueByDate { get; set; }I have tried using a different name

Code
[Column("ExcludeFromPrioritizeByDueByDate")] public bool ExcPByDueByDate { get; set; }

but it does not help.
I have also tried using the fluent configuration

Code
public class JobListConfiguration : EntityTypeConfiguration<JobList> { public JobListConfiguration() { Property(x => x.ExcPByDueByDate).HasColumnName("ExcludeFromPrioritizeByDueByDate"); } }

I am unsure whether the issue is Entity Framework or XAF

Comments (1)

    Answers approved by DevExpress Support

    created 6 years ago

    Hello Kirsten,

    The issue likely occurs because your database system does not support column names of this length. So, the actual column name is truncated, and your Entity Framework data provider cannot find it by the full name. If my supposition is correct, you can reproduce the same behavior without XAF.
    So, instead of making the property name shorter, shorten the column name:

    C#
    [Column("ExcPByDueByDate")] public bool ExcludeFromPrioritizeByDueByDate { get; set; }

    You will also need to rename the database column that is already created, or recreated the database.

    It this does not help, I suggest that you use the SQL queries profiler to determine why data is not loaded. In addition, check if there are any handled exceptions: Collect and Analyze the Diagnostic Information.

      Comments (1)

        Thanks Anatol those suggestions helped.
        It turned out I had misspelt the column name.
        This was not picked up in the log file
        However using the SQL Server Profiler showed that the query was failing.

        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.