在ASP.NET中将数据存储在数据库中 [英] Data Storing in database in asp.net

查看:87
本文介绍了在ASP.NET中将数据存储在数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我正在asp.net中开发一个应用程序,其中我必须在数据库中存储大尺寸图像,所以我的问题是:

在数据库中存储图像的最佳方法是什么,
是将其以二进制格式存储在DB(sql server 2005)中的好方法,还是我应该将图像地址存储在DB中.



还有其他方法可以存储图像吗?

我想以图像格式(.JPG等)存储文本数据.

任何帮助将不胜感激.

感谢您关注这个问题.

问候,

Hello,

I am developing an application in asp.net, in which i have to store large size images in database, so my question is:

What is the best way to store images in database,
Whether its good approach to store it in binary format in DB(sql server 2005), or whether i should store image address in DB.

OR

Is there any other approach for storing images.

I want to store text data in format of images (.JPG etc).

Any help would be appreciated.

Thank you for paying attention to this question.

Regards,

推荐答案

我更喜欢将二进制文件放入数据库中,但这主要是因为
a)我知道它在哪里,并且不需要系统人员来设置网络共享或Web服务器.
b)我可以控制谁可以通过我的应用程序检索数据,而不是依靠文件系统上的权限.我可以非常轻松地在非常细粒度的级别上进行操作.
c)插入文件时,与使用文件系统相比,我获得的交易完整性要简单得多.

反对数据库存储的最佳论据大约是大小-数据库可能变得难以管理.进行数据库备份和维护更加困难;数据库是一个巨大的文件,而如果文件是外部文件,则可以在此处和在此处存放一些文件.
I prefer to put binary in the database, but that''s primarily because
a) I know where it is, and I don''t need a systems guy to set up a network share or webserver.
b) I can control who can retrieve the data through my application, rather than rely on permissions on the file system. I can do it on a very granular level very easily.
c) I get much simpler transactional integrity when inserting files than I would with a file system.

The best argument against database storage are around size - the database might become unmanageable. Much more difficult to do database backups & maintenance; the database is one huge file, whereas if the files are external then you can have some over here and some over there.


这篇关于在ASP.NET中将数据存储在数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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