Posted on: 12/23/2013 7:36:42 PM | Views : 895

Yes I am trying to retrieve my values in a reader. Below I have static values and it work. But I want to retrieve the same info in my reader but i get an error. (( Specified cast is not valid. ))
using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString())) { SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = "select zip, count from table"; conn.Open(); SqlDataReader myReader = cmd.ExecuteReader(CommandBehavior.CloseConnection); while (myReader.Read()) { Chart1.Series["Default"].Points.DataBindXY(myReader.GetDouble(0).ToString(), myReader.GetString(1)); } ...

Go to the complete details ...