Specified cast is not valid?
From your comment: this line DateTime Date = reader.GetDateTime(0); was throwing the exception The first column is not a valid DateTime. Most likely, you have multiple columns in your table, and you’re retrieving them all by running this query: Replace it with a query that retrieves only the two columns you’re interested in: Then try … Read more