I'm crazy because my grid is not showing correctly and found that I am comparing varchar columns (only numeric values) without using '(quote). The problem is that for some numbers the coincidence of the choice and for the other choice do not match.
This is an example:
DataTable tab = new DataTable(); tab.Columns.Add("age", typeof(String)); DataRow row1 = tab.NewRow(); row1["age"] = "8"; tab.Rows.Add(row1); DataRow row2 = tab.NewRow(); row2["age"] = "15"; tab.Rows.Add(row2); Console.WriteLine("Rows with age 8="+ tab.Select("age=8").Length); Console.WriteLine("Rows with age 15=" + tab.Select("age=15").Length);
Exit:
Rows with age 8=0 Rows with age 15=1
Why for 8 numbers do not match and for 15 numbers yes? This is mistake?
source share