I have function that returns string and that works fine but when I call that function from another procedure when it executes function I get a message:
,,Conversion from 'result' to type 'Integer' is not valid,,
ASP debugger says:
,,Input string was not in a correct format. ,,
I tried to use Convert.ToString(), ToInt32() and other but I get the same error.
jugosoft 25 Junior Poster in Training
Recommended Answers
Jump to PostHi,
Usually these kind of errors appear when a non numeric(alpha numeic/string) value is casted to numeric.
for example,
int i = Convert.ToInt32("abc"); int j = Convert.ToInt32("abc12");
The above conversion will throw the error. Can you check the values that are being converted in the …
Jump to PostI guess you were trying to cast a TextBox.Text value. Maybe it was a string in it.
Well, use RegularExpressions to find out if the string contains any charachters.
if(StringContainsCharachters(StringValue)) { throw new Exception("Chars in the string"); } else { // Cast int CastedValue = Convert.ToInt32(StringValue); …
Jump to PostSo why are you trying to convert it to Integer?
Jump to PostPlease put here the code of the getUsername method.
All 16 Replies
MeSampath 4 Junior Poster
iScript 0 Newbie Poster
jugosoft 25 Junior Poster in Training
iScript 0 Newbie Poster
jugosoft 25 Junior Poster in Training
iScript 0 Newbie Poster
jugosoft 25 Junior Poster in Training
iScript 0 Newbie Poster
jugosoft 25 Junior Poster in Training
iScript 0 Newbie Poster
jugosoft 25 Junior Poster in Training
dbeura 0 Newbie Poster
dbeura 0 Newbie Poster
dbeura 0 Newbie Poster
dbeura 0 Newbie Poster
crishjeny -10 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.