float[] array_t = new float[12];
int i=0;
SqlConnection sqlconnection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
sqlconnection.Open();
SqlCommand sqlcommand = new SqlCommand("SELECT * FROM table");
SqlDataReader reader = sqlcommand.ExecuteReader(CommandBehavior.CloseConnection);
if (reader.Read())
{
array_t [0][i] = float.Parse((reader["a"]).ToString());
array_t [1][i] = float.Parse((reader["b"]).ToString());
array_t [2][i] = float.Parse((reader["c"]).ToString());
i++;
}
为何要放二维数组,还有你怎么读的sql?