Simple conversion
Hi,
I am new to C#.. I want to convert a byte or int to string or text.
I have a byte with value 130, I just want to show it in a textBox or a label. If I try to do it directly, like:
txtDataReceived.Text = myDataByte;
then I get the obvious error:
(Cannot implicitly convert type 'byte' to 'string')
I thought it will be very simple.. any idea how to sort it out.
Thanks
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Sateesh ArvetiRank #96 · 22.3K reputationPosted Apr 22, 2009, 1:33 AM EDT
Use .ToString() method on the byte variable (or) Convert.ToString(byte variable)
Ehab Saleh3 reputationPosted Apr 24, 2009, 5:35 AM EDT