将sql server image类型数据转换成字符串时出现乱码
如题:byte[] image = (byte[])dtx.Rows[0]["fileContent"];
string str = Encoding.UTF8.GetString(image);
str是乱码
求解决!!! --------------------编程问答-------------------- 没人解答, 自己顶一个!! --------------------编程问答-------------------- 你确认是UTF8编码 --------------------编程问答-------------------- 不确定, UTF8,GB2312... 好些编码我都试过 都是乱码 --------------------编程问答-------------------- 有没有遇到过相似问题的大神, 求解答!!!! --------------------编程问答-------------------- 你存是什么啊?word?图片?这些是无法进行以字符串显示的。 --------------------编程问答--------------------
存的EXCEL --------------------编程问答-------------------- 那你只能存储xls文件,而不是string str = Encoding.UTF8.GetString(image);
System.IO.File.WriteAllBytes(Server.MapPath("~/xx.xls"),image)
补充:.NET技术 , ASP.NET