我的代码是这样的,但它会出错:
//array_field is an array of double values
NpgsqlCommand Command = new NpgsqlCommand("SELECT array_fied from atable");
NpgsqlDataReader dr = Command.ExecuteReader();
while (dr.Read())
{
double[] rrr = dr.GetDouble(dr.GetOrdinal("array_field"));
}
错误信息是:无法将'double'隐式转换为'double []'。我尝试了其他变体,但也没有用。
感谢你的帮助Judit
答案 0 :(得分:6)
Double[] rrr = dr["array_field"] as Double[];