[DataTable]C# datatable取最大值最小值

ArrayList al = new ArrayList();
DataTable dt = new DataTable();
dt.Columns.Add("A",typeof(double));
dt.Columns.Add("B", typeof(double));
dt.Columns.Add("C", typeof(double));
DataRow dr1 = dt.NewRow();
dr1["A"] = 5.5;
dr1["B"] = -20.6;
dr1["C"] = -3.8;
dt.Rows.Add(dr1); for (int i = ;i< dt.Rows.Count;i++)
{
al.Add(Convert.ToDouble( dt.Rows[i]["A"]));
al.Add(Convert.ToDouble(dt.Rows[i]["B"]));
al.Add(Convert.ToDouble(dt.Rows[i]["C"]));
}
al.Sort();
Response.Write(al[al.Count - ].ToString()+"<br/>");//最大值
Response.Write(al[].ToString());//最小值
上一篇:ASP.NET MVC +EasyUI 权限设计(二)环境搭建


下一篇:JavaScript提高:006:ASP.NET使用easyUI TABS标签updatepanel