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
mlagrangeAsked:
Who is Participating?
 
DreamMasterCommented:
Can you find out what the value is that is passed back? You might be passing back a decimal in a format that is not recognized by the datagrid.

I'd check there first.

Regards,
Max.
0
 
REA_ANDREWCommented:
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?
0
 
mlagrangeAuthor Commented:
Thanks, DreamMaster - when I looked back at the field type in the database, it was different than what I thought it was.



0
 
DreamMasterCommented:
You are very welcome indeed.

Glad to have been helpfull,

Regards,
Max.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.