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
Colt
NA
6
2.4k
Crazy Syntax Error
May 19 2013 6:13 PM
this is the error that i am getting:
FormatException was unhandled
Input string was not in a correct format.
i am getting this from this line of code:
double b = double.Parse(Counter.Text) - .01;
so i rewrote it as this:
string b = Convert.ToString((Convert.ToDouble(Counter.Text)) - .01);
and got the same error
i am using this code like this:
private void Timer()
{
//Starts a conditional loop
//Conditions are that 'TimeInterval' is set to 1
if (Convert.ToBoolean(TimeInterval = 1))
{
//Creates 'b' and sets it to what the current text in 'Counter'
//and takes .01 from it
string b = Convert.ToString((Convert.ToDouble(Counter.Text)) - .01);
//Sets the text displayed in the Points to 'b'
Counter.Text = Convert.ToString(b);
}
}
this is for a small game in my programming class and is the last bit of code i need
any help solving this will be apreciated
Reply
Answers (
2
)
count the hit on product saperately
dropdownlist control in griodview