日期:2014-05-17 浏览次数:21126 次
static void Main(string[] args)
{
DataColumn dc1 = new DataColumn("c1", typeof(System.Double));
DataColumn dc2 = new DataColumn("c2", typeof(System.Double));
DataColumn dc3 = new DataColumn("c3", typeof(System.Double));
DataColumn dc4 = new DataColumn("c4", typeof(System.Double));
DataTable dt = new DataTable();
dt.Columns.Add(dc1);
dt.Columns.Add(dc2);
dt.Columns.Add(dc3);
dt.Columns.Add(dc4);
DataRow dr = dt.NewRow();
dr["c1"] = 6164.97;
dr["c2"] = 3164.97;
dr["c3"] = 3000.0;
dr["c4"] = 0.0;
dt.Rows.Add(dr);
dt.AcceptChanges();
DataRow[] dsx = dt.Select("c1=c2+c3+c4");
DataRow[] dsx1 = dt.Select("6164.97=3164.97+3000.0+0.0");
//为什么这两个Select查询出来的结果不一样
Console.Read();
}