Farhan Shariff

Farhan Shariff

  • NA
  • 933
  • 241.6k

RowFilter from a textbox value

Apr 24 2014 11:16 AM
 I am trying to delete some data in column (Delta_sigma) by comparing it with value entered in textbox but i get error Cannot perform '<' operation on System.Double and System.String.


 DataColumn Delta_sigma = table1.Columns.Add("Delta_Sigma", typeof(double));

Delta_sigma.Expression = "(Convert(Median,'System.Double') -                                        Convert(Median_Refrence,'System.Double')) / (sigma_Refrence)";
 
double delta_sigma_critical = double.Parse(textBox1.Text);


DataRow[] rows4;
 rows4 = table1.Select("  Delta_sigma < delta_sigma_critical ");
            foreach (DataRow r in rows4)
                r.Delete();

Answers (12)