Skip to content

Convert code C# 2008 to code C# 2005 ?

Dong Lam Trien

Asked Feb 24, 2015, 10:36 PM EST2 answers
Share
LinkedInX
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; }
    }
[/code]

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Afzaal Ahmad Zeeshan
    0
    Are you talking about the C#'s language version? 


    You can just cut short the resources or keywords that were added to C# after 2005, and you will have the code written in C# 2005.
    0
  • 0
    It's using lambda expressions and LINQ which isn't supported in 2005 ... I was to learn write code how LINKQ and no LINKQ
    0