c# - reading/writing blob from firebird

浪子不回头ぞ 提交于 2020-01-17 01:39:27

问题


I'm trying to read image from firebird with c#, and save it to file system. I can read from table and save. but image can not be viewed. I tried many piece of code on net.but result is same :( Can any one help me please?


回答1:


How are you retrieving the code form Firebird? If you are getting the data and casting it to a byte[] try:


byte [] blob = row["image"];
// create a file FileStream to write the data
FileStream fs = new FileStream("image.jpg", FileMode.Create); 
fs.Write(blob,0,blob.Length);
fs.Close();

The above code should do the trick.

PS: I have made lots of assumption in the code, but you can get the idea.



来源:https://stackoverflow.com/questions/590508/c-sharp-reading-writing-blob-from-firebird

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!