使用存储过程检索/更新图像 [英] Retrieve/update image using stored procedures

查看:145
本文介绍了使用存储过程检索/更新图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将图片作为BLOB检索/插入到MS SQL数据库中,并显示为数据网格背景或图像.我已经找到了许多使用SELECT和INSERT的示例,但没有使用存储过程的示例.

我通常以以下方式检索/更新数据:

Is it possible to retrieve/insert a picture into a MS SQL Database as a BLOB and display as a datagrid background or image. I''ve found plenty of examples using SELECT and INSERT but none using Stored Procedures.

I usually retrieve/update the data in the following way:

DataContext db = new DataContext();
var q1 = db.LP_List_Active_Entities(1,1,0);
DropDownName.DataSource = q1;
DropDownName.DataBind();

var q2 = db.LP_Automated_Entity_Detection(User.Identity.Name, Convert.ToBoolean(true));
DropDownName.SelectedValue = q2.First().entityid.ToString();



是否可以在不使用SELECT和INSERT的情况下做类似的事情.

这是针对C#的,显示在asp.net

连接和可用的存储过程保存在我的connection.dbml文件中.



Is it possible to do something similar without using SELECT and INSERT.

This is for C# and displayed in asp.net

The connection and available Stored Procedures are saved in my connection.dbml file

推荐答案

与存储过程无关:数据作为字节流重新调整.无论是来自SP还是SELECT查询.

这项工作正在进行显示.这是一个通用类,显示了一种实现方法: ASP.NET的通用Image-From-DB类 [
It has nothing to do with a stored procedure: the data is retuned as a stream of bytes whether from an SP or a SELECT query.

The work is in doing the display. Here is a generic class which shows one way to do it: A generic Image-From-DB class for ASP.NET[^]


这篇关于使用存储过程检索/更新图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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