Specified cast is not valid – SQL float to C# double
You can simply GetDouble
directly:
reader.GetDouble(reader.GetOrdinal("column1"))
I would suggest using the helper classes available through the SqlDataReader object...
double dbl = reader.GetDouble(reader.GetOrdinal("DoubleColumn"));
If there is a chance the column could be null, you should account for that...
double dbl = (reader["DoubleColumn"] != DBNull.Value ? dr.GetDouble(dr.GetOrdinal("DoubleColumn")) : 0.0);
Use Convert.ToDouble
method:
double x = Convert.ToDouble(reader["column1"]);