Link to home
Start Free TrialLog in
Avatar of rmmarsh
rmmarshFlag for United States of America

asked on

Input string not in correct format... why?

I have a column in a database that is defined as small int, with a value of 1.  I am getting an error on this code:

 
tbCopies.Text = data.GetInt16((int)tBooks.Quantity).ToString();

Open in new window


The error is "Input string not in correct format".  Why
ASKER CERTIFIED SOLUTION
Avatar of pivar
pivar
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
In this example, the Quantity value probably gives you an index to a (for example) text column.
Avatar of rmmarsh

ASKER

Thata was it!  Changed the format to "smallint" and it works now.

Thank you very much!

Rolf