My SQL query returns the value as below
Declare @ID varbinary(18)
Declare @newReturnID NvarCHAR(100)
set @ID = CONVERT(VARBINARY(18), CONVERT(VARCHAR(2), CONVERT(VARBINARY(2), 41)) + CONVERT(VARCHAR(64), NEWID()))
select @ID ID
ID(Column name)
0x002936354446393642302D333936312D3436
I need to assign an variable as the above value i am trying to convert into an string but i get an different value ?
foreach (DataRow dr in dt.Rows)
{
byte[] bytes = (byte[])dr["ID"];
string strID = Convert.ToBase64String(bytes, 0, bytes.Length);
}
By my string strID holds different value, not as the above one?
Let me know where I am going wrong?