Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
TextBox3.Text=(Convert.ToInt32(TextBox1.Text) * Convert.ToInt32(TextBox2.Text);


This code is error generate.

plz how to multiply value of two textboxes into the third text box
Posted
Updated 2-Jan-13 7:05am
v2
Comments
__TR__ 2-Jan-13 11:51am    
What's the error message you are getting? Which language are you using?
Please use "Improve question" widget to provide more information and tag your question correctly.
Please go through Code Project Quick Answers FAQ[^] if you have any doubts on how to post a question.
ridoy 2-Jan-13 12:49pm    
What is the error message?

Try:
C#
textBox3.Text = (Convert.ToInt32(textBox1.Text) * Convert.ToInt32(textBox2.Text)).ToString();

C# requires:
1) Correct case names - it is case sensitive so TextBox1 is not the same as textBox1
2) Matched brackets!
3) Unlike VB, C# does not do implicit type conversion - you have to change the type yourself.
 
Share this answer
 
Comments
ridoy 2-Jan-13 12:50pm    
absolutely right..+5
Is this code building in the first place?
I notice an extra bracket TextBox3.Text=(Convert.ToInt32(TextBox1.Text)*Convert.ToInt32(TextBox2.Text); before the first Convert in this line of code.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900