Converting SQL Server varBinary data into string C#

后端 未结 3 1961
小蘑菇
小蘑菇 2020-12-03 13:42

I need help figuring out how to convert data that comes in from a SQL Server table column that is set as varBinary(max) into a string in or

3条回答
  •  广开言路
    2020-12-03 14:19

    You need to know what encoding was used to create the binary. Then you can use

    System.Text.Encoding.UTF8.GetString(reader[1]);
    

    And change UTF8 for whatever encoding was used.

提交回复
热议问题