I have Binary(16) column in table 'Chip' with value 0xE1FC2E6F8674B7B9045C1104F9124C48 and in another table i have column chip_i which is type of integer that has the same value (but in int) = -116241336. Im using SQL Server 2012.
How can i convert 0xE1FC2E6F8674B7B9045C1104F9124C48 to -116241336 in C#?
I tried to convert it like this:
string hexString = "0xE1FC2E6F8674B7B9045C1104F9124C48";
byte[] hexByte = Encoding.ASCII.GetBytes(hexString);
var chip_i = BitConverter.ToInt32(hexByte, 0);
but the result is 826636336