>>If you use UInt32 as storage for the calculation then, by definition, it can exceed the maximum value of an Int32. But this is irrelevant. If you need to compare the calculated CRC value to one already stored in SQL server then simply use the matching .NET type for the calculation....
>>
>>.
>> And, even if the property is declared integer, this wouldn't create an overflow. This is why the program didn't generate an error at calculation time. But, it did generate an error at SQL query time as at that location, we have to build our query with the same type as the type in the table.
>
>Thanks
You might get a clearer idea of what is happening by looking at the byte representations e.g.:
Dim unsigned As UInt32 = UInt32.MaxValue - 1111 ' 4294966184
Dim bytes As Byte() = BitConverter.GetBytes(unsigned) ' 168 251 255 255
Dim signed As Int32 = BitConverter.ToInt32(bytes, 0) ' -1112