Dong Lam Trien

Dong Lam Trien

  • 829
  • 986
  • 149.2k

Convert code C# 2008 to code C# 2005 ?

Feb 25 2015 3:36 AM
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]

Answers (2)