将图像文件保存到数据库中的问题 [英] Problem In Saving Image File into Database
本文介绍了将图像文件保存到数据库中的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
字符串strPhoto = Request.Form ["imageData"]; //从Flash文件中获取图像
byte []照片= Convert.FromBase64String(strPhoto);
插入表中的值(''"+照片+"''),并且Colum的数据类型为Image
实际上,它已保存...但是所有图像都精确地保存了
像这样的相同==>
Hi All,
string strPhoto = Request.Form["imageData"]; //Get the image from flash file
byte[] photo = Convert.FromBase64String(strPhoto);
insert into table values(''" + photo + "'') and Datatype of Colum is Image
Infact it is saved...But all the images are saved with exactly
same bits like this ==>
0x53797374656D2E427974655B5D
0x53797374656D2E427974655B5D
在此先感谢.
Thanks in Advance.
推荐答案
使用 ^ ]用于二进制数据.
另请参见 C#从数据库保存和加载图像 [将图像保存到SQL Server 2000数据库 [ ^ ].
希望对您有所帮助:-)
Use SqlParamenter[^] for the binary data.
See also C# Save and Load Image from Database[^] and Save An Image Into SQL Server 2000 Database[^].
Hope it can help :-)
这篇关于将图像文件保存到数据库中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文