#2
龙胆草2022-09-22 16:22
|
float[] arr_passrate = (from p in ds.Tables["passrate"].AsEnumerable()
select p.Field<float>("rate")).ToArray();
select p.Field<float>("rate")).ToArray();
加强制转换后错误依旧
float[] arr_passrate = (from p in ds.Tables["passrate"].AsEnumerable()
select Convert.ToSingle(p.Field<float>("rate"))).ToArray();
select Convert.ToSingle(p.Field<float>("rate"))).ToArray();
直接用泛型则没有问题
var arr_passrate = from p in ds.Tables["passrate"].AsEnumerable()
select p.Field<float>("rate");
select p.Field<float>("rate");
试过double类型以不行,怎么样解决上面的问题呢?谢谢
[此贴子已经被作者于2022-9-29 07:46编辑过]