I am using LINQ to ENTITIES to pull data from a SQL Server and I am trying to get just the first 255 characters from one of the columns who's data type is NTEXT
. When I try I get the error:
Argument data type ntext is invalid for argument 1 of len function
The code producing the error is:
Subject = (yt.Message.Length > 255) ? yt.Message.Substring(0, 255) : yt.Message
Is there an easy way to either get the length so I can check it or just get the first 255 characters of an NTEXT
column?
Trying to do yt.Message.ToString().Length
gives the same error.
This is a third party DB for a forum software I am using and since I don't know anything about how that system works I want to stay away from altering any of the schema.