如何在3tier体系结构中通过具有imagepath的存储过程存储图像 [英] how to store images by stored procedure with imagepath in 3tier architecture

查看:70
本文介绍了如何在3tier体系结构中通过具有imagepath的存储过程存储图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请有人帮忙如何在3层体系结构中使用存储过程存储图像,在2层中,我能够插入图像路径为〜/images/7s.gif
的图像
但是现在我要使用存储过程创建具有3层体系结构的应用程序,我不知道如何通过存储过程使用imagepath插入,更新和删除图像.

请一些帮助....

Pls someone help that how to store images using stored procedure in 3 tier architecture,in two tier i am able to insert images with image path like ~/images/7s.gif

but now i am going to create application with 3 tier architecture using stored procedure, I dont know that how insert, update, delete images with imagepath by stored procedure.

Pls some one help....

推荐答案

,在两层中,我能够插入图像路径为〜/images/7s.gif
但是现在我要使用存储过程创建具有3层体系结构的应用程序
好吧,如果您在2层中成功,那么您在3层中也成功.通过存储预期的图像,分层不会对您造成太大影响.

您需要了解3层体系结构的含义.它是一种将UI,业务逻辑和数据库操作分离的体系结构.因此,可以说如果您知道如何在1层中执行特定功能,则在3层中所需要做的就是将UI,BL,DAL的代码分开,并使用dll/class引用来使用它们.

创建一个类库-BusinessLogic
创建一个类库-DataAccess

现在,从您的UI,使用对象模型并传递给BusinessLogic项目类.此类是业务逻辑类.在此处根据您的需要进行更改.
现在,将更改后的数据从业务逻辑类传递到dataAccess项目类.在此类中,使用ADO.NET并将所需的值传递给存储过程.

为了获取数据,数据将从DA传输到BL层,然后再从BL传输到UI层.
看看这些,用示例进行解释:
C#中的3层体系结构 [ 3-层架构示例 [使用C#的ASP.NET中的3层体系结构 [
,in two tier i am able to insert images with image path like ~/images/7s.gif
but now i am going to create application with 3 tier architecture using stored procedure
Well, if you succeeded in 2-tier than you have succeeded in 3 tier too. From storing images prospective, the layering is not going to affect much to you.

You need to understand what a 3-tier architecture means. It''s an architecture where you decouple UI, business logic and database operations. So, lets say if you know how to do a particular feature in a 1-tier, all you need in 3-tier is to separate the codes of UI, BL, DAL and use the dll/class references to use them.

Create a class library - BusinessLogic
Create a class library - DataAccess

Now, from your UI, use the object model and pass on to BusinessLogic project class. This class is a Business logic class. Do the changes as per your need here.
Now, pass on the changed data from business logic class to dataAccess project class. In this class, use ADO.NET and pass on the needed values to Stored Procedure.

For getting back data, it will be transferred from DA to BL and then BL to UI layer.
Have a look at these, explaination with samples:
3-tier architecture in C#[^]
3-Tier Architecture Examples[^]
3-Tier Architecture in ASP.NET with C#[^]


这篇关于如何在3tier体系结构中通过具有imagepath的存储过程存储图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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