将图像存储到数据库 [英] Store Images to database

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

问题描述

大家好.

我只是有一个小问题.

我有一大堆图像.我想将其存储在数据库中.我的意思是说:-我有1000张壁纸,我想将其保存到sql数据库中,以便在我的vb.net程序中使用它.

我不想创建程序来保存图像..不!


我想要的是创建图像数据库,我已经有了他的照片.
这就是我想要的一切

请帮忙 .感谢所有

Hello everyone.

i just have a small question.

i have a large group of images. and i want to store it in database. i mean for ex:- i have 1000 wallpapers and i want to save it to sql database to use it in my vb.net program .. this is at first.


i don''t want to create program to save images .. No!!


what i want is create image database i already have the his picture .
that''s all what i want

please help . Thanks for all

推荐答案



在这里,您将找到解决问题的起点:
http://www.beansoftware.com/ASP.NET-Tutorials/Save- Read-Image-Database.aspx [ ^ ]

查看文章结尾处的源代码.

我在MSDN上发现的有关图像数据类型的内容是这样的:
http://msdn.microsoft.com/en-us/library/ms187993.aspx [ ^ ]

在那里,您将看到在将来的MS-SQL版本中将不再显示图像数据类型. Microsoft建议您为以后的项目使用varbinary(max)( http://msdn.microsoft.com/zh-cn/library/ms188362.aspx [ ^ ]).

希望这会有所帮助.

致以诚挚的问候,祝您编程愉快,
克里斯
Hi,

Here you will find a starting point to solve your problem:
http://www.beansoftware.com/ASP.NET-Tutorials/Save-Read-Image-Database.aspx[^]

Look at the source code at the end of the article.

What I found at MSDN about the image datatype is this:
http://msdn.microsoft.com/en-us/library/ms187993.aspx[^]

There you will see that the image datatype will be disconinued in future versions of MS-SQL. Microsoft recommends that you use a varbinary(max) for future projects (http://msdn.microsoft.com/en-us/library/ms188362.aspx[^]).

Hope this helps.

Best regards and happy coding,
Chris


如果您有1000张壁纸,那么说实话,最好,最快,最准确的方法就是创建一个快速程序来做到这一点.替代方案将非常费力-程序只是此文件夹:加载所有.JPG文件"的一种情况.这并不难(如果需要,它是一个二十行以下控制台应用程序!)在手动将图像放入数据库的情况下,每20张图像中完成图像的时间可能要比编写测试和准备好更多的时间. -运行整个应用程序!
If you have 1000 wallpapers then to be honest the best, quickest, most accurate way is going to be to cretae a quick program to do it. The alternatives are going to be very labour intensive - a program is just a case of "this folder: load all .JPG files". It''s not difficult to do (hell, it''s a sub twenty line console app if necessary!) Where as gettingthe images into a DB manually is probably more time to do per 20 images image than it is to write test and ready-to-run the whole app!


就OriginalGriff的建议而言,我怀疑编写这样的应用程序需要20行代码.因此,如果您对C#有点熟悉,则可以在演示项目 C#-dataCollector –收集和轻松保存数据.
我希望从有用的示例中学到东西会很有趣.
With all respect to OriginalGriff''s proposal, i doubt that to write such application will take 20 lines of code. Thus, if you are familiar a bit with C# you can try this CP source code with demo project C# - dataCollector – Collecting and Saving Data Easily.
I hope, it will be fun to learn something from useful example.


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

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