I want to remove a column from datatable
the column is a part of expression I want to remove it once the expression is calculated.
Lower.Expression = "(Convert(µ,'System.Double')-Convert(LSL,'System.Double'))/(3.0*sigma)";
Upper.Expression = "(Convert(USL,'System.Double')-Convert(µ,'System.Double'))/(3.0*sigma)";
CpK.Expression = "IIF(Lower < Upper, Lower, Upper)";
I want to remove lower and upper once the data is populated
Loading

VulpesPosted Mar 20, 2014, 6:47 AM
If you really need to do this, then you'd have to forego setting the Expression property and simply calculate the values of the 'computed' column manually before removing the 'surplus' columns.
Secondly, you can't hide columns in a DataTable because the DataColumn class doesn't have a Visible property - hence the exception you're getting. What you could do is to bind the table to (say) a DataGridView and then hide the appropriate columns of that.
Farhan ShariffPosted Mar 20, 2014, 6:31 AM