LINQ to SQL - Get only substring from a field

Posted by domanokz on Stack Overflow See other posts from Stack Overflow or by domanokz
Published on 2011-11-17T09:47:56Z Indexed on 2011/11/17 9:50 UTC
Read the original article Hit count: 158

Filed under:
|

I'm studying ASP.NET MVC and I use LINQ to SQL for model.

I have a table named "Note" with the fields "Title" and "Content". The "Content" field can contain thousand characters.

What I want to do is to display the LIST of notes in a page. I use table with two columns, for "Title" and SUBSTRING of the "Content" (50 characters). My problem is, I don't know how to edit the model so that it will display only the substring of the "Content".

Thanks in advance!

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about linq-to-sql