TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
praveenreddy
NA
2
0
Overflow Exception
Apr 26 2005 3:46 AM
I'm getting the following error message when i try to convert Float to Int32. Message = Value was either too large or too small for an Int32. Source = mscorlib Method = ToInt32 StackTrace = at System.Convert.ToInt32(Double value) at CheckError(String DataValue) here is the CheckError() method: public static string CheckError(string DataValue) { try { float a=(float)Convert.ToDouble(DataValue); if(a > UniqueErrorCode) { return PIDataValue; } else //Quality check { a = a -(UniqueErrorCode); switch(Convert.ToInt32(a)) { case -313:return "Fail"; case -307:return "Bad"; case -254:return "ShutDown"; default : return "BadData"; } } } catch(Exception ex) { return "Error"; } } Please suggest me to fix this.
Reply
Answers (
0
)
Specified cast is not valid
Hello,Everybody!