CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2007
    Posts
    405

    Convert code C# 2008 to code C# 2005 ?

    I want convert code C# 2008 to code C# 2005, I did not understand the command C# 2008 to switch to C# 2005, see below is the error code can solve the error command do ? run the code in C# 2008 very good


    Code:
    private void textBox1_TextChanged(object sender, EventArgs e)
            {
                string str = textBox1.Text.Trim();
    
    
                if (!string.IsNullOrEmpty(str))
                {
                    // Error in here
                    Expression<Func<CustomData, bool>> expr = n => GetCondition(n, str);
                    this.gridControl1.DataSource = this.lstCustomData.Where<CustomData>(expr.Compile()).ToList();
                }
                else
                    this.gridControl1.DataSource = this.lstCustomData;
                this.gridControl1.RefreshDataSource();
            }
    
    
    public class CustomData
        {
            // Error in here
            public int col1 { get; set; }
            public string col2 { get; set; }
            public string col3 { get; set; }
            public int col4 { get; set; }
        }

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Convert code C# 2008 to code C# 2005 ?

    What errors (exactly!) do you get?
    Victor Nijegorodov

  3. #3
    Join Date
    Feb 2015
    Posts
    6

    Re: Convert code C# 2008 to code C# 2005 ?

    you can try this/

  4. #4
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: Convert code C# 2008 to code C# 2005 ?

    Switching back to a previous version just because you don't understand the newer methods is not the way to go.... I suggest learning LINQ and see how easy it can make everything for you

  5. #5
    Join Date
    Sep 2007
    Posts
    405

    Re: Convert code C# 2008 to code C# 2005 ?

    I'm looking to understand how the .Net 2.0 and .Net 3.5, I think someone who understands and will move the code.

  6. #6
    Join Date
    Sep 2007
    Posts
    405

    Re: Convert code C# 2008 to code C# 2005 ?

    Quote Originally Posted by Nuttyrunner View Post
    you can try this/
    I tried the link you sent it, the program is not convert to C# 2005

  7. #7
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Convert code C# 2008 to code C# 2005 ?

    Quote Originally Posted by dongtrien View Post
    I tried the link you sent it, the program is not convert to C# 2005
    Probably should have asked th9s earlier, but what do you hope to accomplish by going back to VS 2005?

  8. #8
    Join Date
    Sep 2007
    Posts
    405

    Re: Convert code C# 2008 to code C# 2005 ?

    not necessarily so, I am learn 2 type writing linkq and style of writing standards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured