如何使用asp.net(c#)在数据库中存储和检索图像 [英] how to store and retrieve image in database with asp.net(c#)
本文介绍了如何使用asp.net(c#)在数据库中存储和检索图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对图像上传有一点怀疑,请给我正确的编码.
ado.net连接是主要错误.
问候mohan
Hi,
I have small Doubt for Image upload, and Give me a proper coding.
ado.net connectivity is main error.
regards mohan
推荐答案
这里 [ ^ ]是一个很好的示例.
在互联网上搜索将为您提供更多.
Here[^] is a perfectly good sample.
Searching on the internet will give you many more.
此链接将为您提供帮助
从数据库中保存和检索图像[
this link will help you
Save and Retrieve Images from the Database[^]
这是解决方案
Here is the solution
HttpPostedFile file = fileImage.PostedFile;
byte[] bytPDF = new byte[file.ContentLength];
Stream objStream;
objStream = file.InputStream;
objStream.Read(bytPDF , 0, file.ContentLength);
string fileName = file.FileName.Trim();
这篇关于如何使用asp.net(c#)在数据库中存储和检索图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文