如何使用存储过程方法使用c#从sql server数据库asp.net存储和检索图像 [英] how to store and retrieve the images from sql server database asp.net with c# by using Store procedure method

查看:99
本文介绍了如何使用存储过程方法使用c#从sql server数据库asp.net存储和检索图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助。我正在开发产品详细信息项目。所以我从sql server database插入并检索产品图片。我不知道这个概念。



请帮帮我

 

解决方案

从文件加载图片后,你必须将其转换为bytes数组,然后将结果保存到SQL表中的image字段中。要从DB加载图像,你应该以相反的方式加载。


我更喜欢的另一种方法是只存储数据库中图像的路径并将图像放在某处您的IIS服务器。


请阅读 thread 作为数据库中基本保存和检索图像的参考。 。 。 。

希望它会有所帮助。

I need a help.i am developing product details project.so i am insert and retrieve product images from sql server database.i don't know this concept.

please help me

解决方案

After you loading the image from file, you have to convert it to bytes array, then save the result into a "image" filed in your SQL table. To load the image from DB you should do in the reverse way.


Another way, which I prefer, is to just store the path to the image in the database and have the images somewhere on your IIS server.


Please read this thread as your reference for basic save and retrieve of images in database. . . .
hope it will help. .


这篇关于如何使用存储过程方法使用c#从sql server数据库asp.net存储和检索图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆