title: display the first N words from database field in DataList
body: <p>I need to get first n words from database and display them in the DataList. I'm using LINQ to SQL.
  I Have searched a lot but can't find a way doing this, I'm trying make a list of article with 300 character of them and a Read More link,I will be able to handle the read more button and showing article page but I stuck in showing limited words in articles list. I'm using DataList because I want to simply display other fields in
  it.</p>
  
  <p>I can make array of my table column an i have number of rows:</p>
  
  <pre><code>var arc = (from a in data.Articles select a).Count();
  var ar = (from a in data.Articles select a.ArticleText).ToArray();
  var article = ar; 
  </code></pre>
  
  <p>and this is how I can extract 5 words from a string:</p>
  
  <pre><code>string firstWords = Regex.Match(testString, @"^(\w+\b.*?){5}").ToString();
  </code></pre>
  
  <p>I can't make this things work together</p>
  
  <p>is it possible to use eval expression for arrays?</p>
  
  <p>update: I did a typo mistake in my question wrote gridview instead of datalist.                             </p>
  
  <p>update2: I could make a array of limited words and bind it to datalist by puting &lt;%#Container.DataItem %> in datalist but I can't use other datasources like linqdatasource to use eval to showing other data fields  because I used datalist1.DataSource = ar.</p>
  
  <p>code:</p>
  
  <pre><code>string[] limitedarticle;
  limitedarticle = new string[arc];
  
  for (int i = 0; i &lt; arc; i++)
   {
  
     limitedarticle[i] = Regex.Match(article[i], @"^(\w+\b.*?){5}").ToString();
  
  
   }
  datalist1.DataSource = ar ;
  datalist1.DataBind();
  </code></pre>
  
  <p>I appreciate any guidance and help</p>