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]
Convert code C# 2008 to code C# 2005 ?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Afzaal Ahmad ZeeshanRank #60 · 27.6K pointsPosted Feb 24, 2015, 11:10 PM EST
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.
Dong Lam TrienRank #1,538 · 1K pointsPosted Feb 25, 2015, 5:19 PM EST