Constant value '461' cannot be converted to a 'byte'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vinayaktripathi
    New Member
    • Apr 2010
    • 1

    #1

    Constant value '461' cannot be converted to a 'byte'

    Hi all,

    I need to send following data to a network device.

    byte[] MyArray=new byte[] { 0x00, 0x00, 0x00, 0xAF, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1CD };
    But getting error :

    "Constant value '461' cannot be converted to a 'byte'"


    Any solution?

    Thanks,
    Vinayak
  • Monomachus
    Recognized Expert New Member
    • Apr 2008
    • 127

    #2
    Originally posted by vinayaktripathi
    Hi all,

    I need to send following data to a network device.

    byte[] MyArray=new byte[] { 0x00, 0x00, 0x00, 0xAF, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1CD };
    But getting error :

    "Constant value '461' cannot be converted to a 'byte'"


    Any solution?

    Thanks,
    Vinayak
    0x1CD is not a byte. A byte value is from 0..255 or 0x00 to 0xFF. So it is not a byte.

    Comment

    Working...