i need to multiple this two values.Coding is
[code]
int
s = Convert.ToInt32(txtIntW.Text); double i =6.5; //lblResultW = Convert.ToInt32(s) + Convert.ToInt32(i);lblResultW.Text =i * s;
[/code]
but its showing Error.please help me to solve this.Thx
i need to multiple this two values.Coding is
[code]
int
s = Convert.ToInt32(txtIntW.Text); double i =6.5; //lblResultW = Convert.ToInt32(s) + Convert.ToInt32(i);lblResultW.Text =i * s;
[/code]
but its showing Error.please help me to solve this.Thx
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Johnny GC44 reputationPosted Jun 8, 2008, 3:35 AM EDT
what about lblResultW.Text = (i * s).ToString();
lanka pala3 reputationPosted Jun 8, 2008, 12:08 PM EDT
lblResultW.Text = (i * s).ToString(); This coding is working.thank you very much
but now
[code]
double
s =Convert.ToDouble(txtIntW.Text);[/code]
is not working.first time its working if i select second time its showing wrong data type.
Neetika Gupta12 reputationPosted Jun 9, 2008, 3:36 AM EDT
Ryan AlfordRank #1,411 · 1.2K reputationPosted Jun 9, 2008, 5:31 AM EDT
int s = ....;
double s = ....;
just because they are different datatypes doesn't mean the compiler will see them as different variables.