Hello everybody,

Let me explain my problem. I have one datatable with all my data and the above function to calculate the eclidian distance.

My function returns a DataColumn so I can add this column later to another datatable.

The problem is that I´m not being able to populate the datatable whit the Table.NewRow() method?

Can anyone help me?

Thanks in advance!

```
public DataColumn distanciaEclidiana(DataTable dt, DataRow distRefRow, List<string> campos)
{
DataColumn Dist = new DataColumn();
Dist.DataType = typeof(float);
Dist.ColumnName = "Dist";
foreach(DataRow dr in dt.Rows)
{
float soma = 0;
foreach (string col in campos)
{
soma += (float)Math.Pow(Convert.ToDouble(distRefRow[col]) - Convert.ToDouble(dr[col]), 2);
}
// The problem is here
DataRow row = Dist.Table.NewRow();
row["Dist"] = (float)Math.Sqrt(soma);
}
return Dist;
}
```