This is a migrated thread and some comments may be shown as answers.

has no supported translation to SQL error

1 Answer 92 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jonathan
Top achievements
Rank 1
jonathan asked on 18 Oct 2010, 03:30 PM
I am using Linq to Sql and a LinqDatasource.  I have added a property to one of the class linq classes that were created as below.
public string FullName
        {
            get { return string.Format("{0}, {1}", this.LastName, this.FirstName); }
        }

When trying to sort or filter on this column I receive The member FullName has no supported translation to SQL error. 

Does anyone know how to get around this.  I realize there is no column in the database called Fullname.  I can set the sort expression of the coulmn to "User.LastName + User.FirstName" and this works, but it still errors when filtering.

Thanks for any help.

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 21 Oct 2010, 05:16 PM
Hello Jonathan,

I am afraid that LinqDataSource will attempt to translate the expression in SQL and will fail as at table level there is no such column. You can use custom sorting as shown on the demo bellow:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/sort/defaultcs.aspx

Greetings,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
jonathan
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or