Return the number of characters in a text field or in the text representation of a field.
public FunctionReference Length( )
Length takes no parameters
A reference to a column being selected with a string length function applied to it
||You have passed one or more arguments to
Note that issues #289 - #290 are still open with regards to exceptions thrown by Length.
Length must be called only within a
Select clause, appended to one of the fields being selected.
Lengthon a non-string field, the value returned is that of the string representation of that field
Lengthwill not apply grouping to the query.
To return the length of each title of the Albums in the Albums table, and reference it as TitleLength, use the following code:
var details = db.Albums.Select(db.Albums.Title.Length().As("TitleLength"));
Simple.Data sends the following SQL to the database when details is evaluated
select len([dbo].[Albums].[Title]) AS [NameLength] from [dbo].[Albums]