Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Text Third box
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 2-Jan-13 6:43am
Edited 2-Jan-13 8:05am
v2
Comments
__TR__ at 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 at 2-Jan-13 12:49pm
   
What is the error message?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Try:
            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.
  Permalink  
Comments
ridoy at 2-Jan-13 12:50pm
   
absolutely right..+5
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 195
1 ProgramFOX 130
2 Maciej Los 105
3 Afzaal Ahmad Zeeshan 82
4 Sergey Alexandrovich Kryukov 75
0 OriginalGriff 6,564
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,228
3 Manas Bhardwaj 4,717
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web01 | 2.8.1411022.1 | Last Updated 2 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100