try using
ushort tmp = ushort.Parse(yourstring) ;
if(YourUShort != tmp) { }
Cheers,
Greg Young
MVP - C#
http://codebetter.com/blogs/gregyoung
"Marcelo Muzilli" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Howdy all,
>
> in my program, I have a ushort variable and a string variable and if I try
> to compile it, I'm receiving this error message: "Cannot convert type
> 'string' to 'ushort'".
>
> How can I compare both?
>
> Example:
>
> if ( uVariable != sVariable ) { ... }
>
> Tia,
>
> Marcelo Muzilli