Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am retrieving bulk data from database and making changes in that data but it give me error outofmemoryexception. below is my code

C#
public void AddArticleRefrences(ref List<Article> art)
{
    string blueWordStyle = "text-decoration: none; border-bottom: 1px solid #663366;color: #0000CC;";
    ArticalDAO objArt = new ArticalDAO();
    List<Article> MainArticle = objArt.GetListArticle(1);

    foreach (Article main in MainArticle)
    {
        foreach (var content in art)
        {
            content.Contents = Regex.Replace(content.Contents, main.Header, string.Format("<a href='{0}' target='_blank' style='{1}'>{2}</a>", "ViewArticle.aspx?Code=" + main.ArticleCode, blueWordStyle, main.Header));
        }
    }
}
Posted
Comments
abbaspirmoradi 6-Dec-13 3:36am    
debug your code step by step and see where row your exception happen..
Manohar Khillare 6-Dec-13 4:25am    
error occur in content.Contents
JoCodes 6-Dec-13 4:19am    
Error in which line?
Manohar Khillare 6-Dec-13 4:23am    
error occur in content.Contents
JoCodes 6-Dec-13 4:31am    
Whats the Count in your List?

1 solution

List MainArticle = objArt.GetListArticle(0);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900