HELP ME C#?????????

Posted by Pokuri31 under ASP.NET on 11/15/2008 | Views : 1453 | Status : [Member] | Replies : 4
Hi,

Friends, i have one doubt , because i am in learning stage .


Multiply two numbers? one from combox and another one is textbox? it is possible in c# or not?
if it is possible please help me?

int i = int.Parse(comboBox2.SelectedValue);//error


int j = int.Parse(textBox1.Text);

int k = i * j;

textBox2.Text = k.ToString();




Responses

Posted by: Jayakumars on: 9/30/2012 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi


int i = Convert.ToInt32(comboBox2.SelectedValue);//error
int j = Convert.ToInt32(textBox1.Text);
int k = i * j;
textBox2.Text = k.ToString();



Mark as Answer if its helpful to you

Pokuri31, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 9/30/2012 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi
Please mark as answer Resolved Posts if it helpful to you.

Mark as Answer if its helpful to you

Pokuri31, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 11/16/2008 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Its Possible

int i = (int) ComboBox2.Text();


int J = (int) textBox1.Text();

int K = i* J;

textbox2.Text = K ;


Why do you Convert that Bolded K to String ?

Thank you for posting at Dotnetfunda
[Administrator]

Pokuri31, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: SheoNarayan on: 11/17/2008 [Administrator] HonoraryPlatinum

Up
0
Down
Its possible.
Had you tried the attachment of the Question you had asked earlier on almost same topic?(http://www.dotnetfunda.com/questions/question250.aspx ).

You can try running the sample and see how it is functioning. You should not get any error in the following line provided you have some integer value in the Combo box.

int i = int.Parse(comboBox2.SelectedValue);

Again, I suggest you to download the sample and run it.

Thanks



Regards,
Sheo Narayan
http://www.dotnetfunda.com

Pokuri31, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response