Link to home
Start Free TrialLog in
Avatar of mlagrange
mlagrangeFlag for United States of America

asked on

Getting "Input string was not in a correct format"

I just set up a GridView control on a new page, got the <columns> set up the way I need, and when I tried to "Edit" and "Update", I got the error message above.

I couldn't tell which field was causing the error, so I cut them all out of the control, except for a few text fields that already had values, and started adding them back one at a time to see which was the problem field.

The fields I added back were of assorted data types (text, date, currency, yes/no), and the page was working fine after each restored field.

But finally, when I added back a field that was just a straight number, I got the error.

And when I took that column back out, I STILL got the error!

Any ideas what the problem is?

Thanks

Mark
Avatar of REA_ANDREW
REA_ANDREW
Flag of United Kingdom of Great Britain and Northern Ireland image

please can you post your GridView script please. Oh and how do you bind the data, using the code behind or using the SQL Data Source?

If you used data Reader, then you might have used GetString() for all. Is this the case?
ASKER CERTIFIED SOLUTION
Avatar of DreamMaster
DreamMaster

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
Avatar of mlagrange

ASKER

Thanks, DreamMaster - when I looked back at the field type in the database, it was different than what I thought it was.



Avatar of DreamMaster
DreamMaster

You are very welcome indeed.

Glad to have been helpfull,

Regards,
Max.