如何在MVC5中使用jqgrid从我的SQL Server数据库中检索图片 [英] How do I retrieve pictures from my SQL Server database using jqgrid in MVC5

查看:106
本文介绍了如何在MVC5中使用jqgrid从我的SQL Server数据库中检索图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我是MVC5和jqgrid的新手,我想使用asp.net mvc代码第一种方法从我的SQL服务器数据库中检索图像到jqgrid。如果有人能帮助我,那将是一件非常愉快的事情!谢谢。

Hello. I am totally new to MVC5 and jqgrid and I want to retrieve images from my SQL server database to jqgrid using asp.net mvc code first approach. If anyone can help me it would be a great pleasure! Thanks.

推荐答案

请看我对这个问题的评论。所有谈论MVC,特别是jQuery UI插件与存储和检索图像完全无关。



首先,对于网站/应用程序,我会建议将图像作为文件存储在服务器主机的文件系统中。数据库可用于存储文件名。名称应该是一些唯一的相对文件名(或简单的文件名),在某些子目录中的某些文件集中是唯一的,具有嵌套的子目录或没有它们。



但是如果你不想听这个建议,你可以将图像本身存储在数据库中,只有一次又一次地回答已经回答了很多次的问题是不好的:搜索 - CodeProject [ ^ ]。



-SA
Please see my comment to the question. All talking about MVC and especially jQuery UI plug-ins is totally irrelevant to storing and retrieving images.

First of all, for a Web site/application, I would recommend storing images as files, in the file system of the server's host. The database can be used to store just the file names. The names should be some unique relative file names (or simple file name), unique in some set of files in some sub-directory, with nested sub-directories or without them.

But if you don't want to listen to this advice, you can store the images themselves in a database, only it would be bad to answer again and again the question which has been answered so many times: Search — CodeProject[^].

—SA


这篇关于如何在MVC5中使用jqgrid从我的SQL Server数据库中检索图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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