Specified cast is not valid – SQL float to C# double

Viewed 11654

In my c# code, I have a double that I am trying to set to the value that is in my SQL Management 2008 R2 database that is of type float (which corresponds to a double in c#, right?). When I use this syntax

double x = (double)reader["column1"]; //reader is SqlDataReader object

I get the error "specified cast is not valid."

What gives?

3 Answers
Related