Execution of 'System.Char:IsLetter(Char)' on the dat

Posted by Community Admin on 04-Aug-2018 20:12

Execution of 'System.Char:IsLetter(Char)' on the database server side currently not implemented.

All Replies

Posted by Community Admin on 01-Apr-2014 00:00

I am trying to get a collection of DynamicContent that begins with with a non-alphabetic value.

 This was my first attempt:

query = query.Where(s => s.Status == ContentLifecycleStatus.Live && s.Visible == true
                        && !char.IsLetter(s.GetValue<string>(fieldName).First()));

So then I stumbled upon an old post on the Telerik forums and tried something else, but that too doesn't work, plus I don't want to generate the entire list in memory before I filter it down.

 

query = (IQueryable<DynamicContent>)query.ToList().Where(s => s.Status == ContentLifecycleStatus.Live && s.Visible == true
                        && !char.IsLetter(s.GetValue<string>(fieldName).First()));

How else can I accomplish this?

Posted by Community Admin on 02-Apr-2014 00:00

Is it just 1-9 that are acceptable?

 FYI if no records are returned .First() will throw an exception, recommend FirstOrDefault

Posted by Community Admin on 02-Apr-2014 00:00

@Steve

1-9 are the only values for that particular query that I care about and after looking at it more I am missing a .StartsWith() before that I need to add.  I already have an a-z filter working, but the requirement is to offer users a button to then get all company names that begin numerically.  

I thought about looping through 1-9 and then doing then check on company name.  Hoping there is some LINQ magic I am missing that will get me there (assuming its implemented)

 

This thread is closed