object maxA = dt.Compute("Max(A)", "");
object minA = dt.Compute("min(A)", "");
object maxB = dt.Compute("Max(B)", "");
object minB = dt.Compute("min(B)", "");
object maxC = dt.Compute("Max(C)", "");
object minC = dt.Compute("min(C)", "");
或者
//求3列的最大和最小值
ArrayList al = new ArrayList();
DataTable dt = new DataTable();
for (int i = 0; i++; i < dt.Rows.Count)
{
al.Add(dt.Rows[i]["A"].ToString().Trim());
al.Add(dt.Rows[i]["B"].ToString().Trim());
al.Add(dt.Rows[i]["C"].ToString().Trim());
}
al.Sort();
MessageBox.Show(al[al.Count -1].ToString ());//最大值
MessageBox.Show(al[0].ToString());//最小值