I\'m having a \"Specified cast is not valid\" error. Windows form application in C#. I\'m trying to retrieve a value from a table. The value is either a smallint, or a numer
Try using SqlDataReader's GetInt32()
rdr.GetInt32(rdr.GetOrdinal("quantity"));