sum - cannot implicitly convert type 'int' to 'string' in C# -


i want make programs sum 2 number in 2 text box it's not working. don't know why. (and sorry bad english skill xd).

here's code :

textbox3.text = convert.toint32(textbox1.text) + convert.toint32(textbox2.text); 

since result of operation not string int have call tostring() assign string value textbox3.text

textbox3.text = (convert.toint32(textbox1.text) + convert.toint32(textbox2.text)).tostring(); 

working code:

string y = ""; y = (convert.toint32("3") + convert.toint32("4")).tostring(); 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -