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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ryan AlfordPosted Jun 9, 2008, 9:31 AM
int s = ....;
double s = ....;
just because they are different datatypes doesn't mean the compiler will see them as different variables.
Neetika GuptaPosted Jun 9, 2008, 7:36 AM
lanka palaPosted Jun 8, 2008, 4:08 PM
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.
Johnny GCPosted Jun 8, 2008, 7:35 AM
what about lblResultW.Text = (i * s).ToString();