table 1
| Par Name | SKIP | Lowest value | Highest Value |
| D_Id | 0 | ||
| Split | 0 | ||
| Val_2 | 0 | ||
| Val_1 | 0 | ||
| Val_4 | 0 |
table5
| D_ID | Split | Val_1 | Val_2 | Val_4 |
| N_01 | Ret | -0.13672 | -0.56202 | -0.4211 |
| N_92 | Ret | -0.13767 | -0.13911 | -0.56752 |
| N_03 | Stress | -0.13711 | -0.42072 | -0.41932 |
| N_98 | Stress | -0.6132 | -0.41979 | -0.42025 |
| N_56 | Stress | -0.42026 | -0.41955 | -0.1367 |
for (int q = 2; q < table1.Rows.Count; q++)
{
string colVal = table1.Rows[q]["Par Name"].ToString();
if(table5.Columns.Contains(colVal))
{
// Error : Specified cast is not valid
table1.Rows[q]["Lowest value"] = table5.AsEnumerable().Min(r => r.Field
table1.Rows[q]["Highest Value"] = table5.AsEnumerable().Max(r => r.Field
}
}
output table
| Par Name | SKIP | Lowest value | Highest Value |
| D_Id | 0 | | |
| Split | 0 | | |
| Val_2 | 0 | -0.56202 | -0.13911 |
| Val_1 | 0 | -0.6132 | -0.13672 |
| Val_4 | 0 | -0.56752 | -0.1367 |

VulpesPosted May 22, 2014, 12:02 PM
table1.Rows[q]["Lowest value"] = table5.Rows.Cast
table1.Rows[q]["Highest Value"] = table5.Rows.Cast
If they're strings, then change:
double.Parse( r.Field
VulpesPosted May 23, 2014, 9:28 AM
Farhan ShariffPosted May 23, 2014, 3:49 AM
for (int q = 2; q < table1.Rows.Count; q++)
{
}
since first and second column are D_Id and Split is there a much effective way to do that ?
Farhan ShariffPosted May 23, 2014, 3:32 AM