I have some code where I am moving an integer to an integer and I am getting a casting error. But I am casting it as an integer - which it is.
int surveyTestAnswerID = 0;
surveyTestAnswerID = (int)dbReader["SurveyTestAnswerID"];
I get an error here as:
Specified cast is not valid ????
The value of dbReader["SurveyTestAnswerID"] is 23697 which is an integer. The stored procedure has the value coming from the Scope_Identity() of the value which is an integer.
How can this not be casted correctly???
Thanks,
Tom
int surveyTestAnswerID = 0;
surveyTestAnswerID = (int)dbReader["SurveyTestAnswerID"];
I get an error here as:
Specified cast is not valid ????
The value of dbReader["SurveyTestAnswerID"] is 23697 which is an integer. The stored procedure has the value coming from the Scope_Identity() of the value which is an integer.
How can this not be casted correctly???
Thanks,
Tom