如何将图像从Picturebox保存并检索到SQL Server 2014数据库字段类型“图像”在vb.net中

问题描述:

嗨!



我在使用SQL Server 2014的VB.Net 2010中工作。



我需要将图像从图片框保存到数据库字段(类型=图像),并检索该图像并将其显示在同一个图片框中。

我还想保持图像质量作为原始文件。



任何人都可以帮助我!



谢谢

Hi!

I am working in VB.Net 2010 with SQL Server 2014.

I need to save an image from a picture box to the database field (type=image) and also retrieve back that image and show it in the same picture box.
I also want to maintain the image quality as the original file.

Can anyone help me !

Thanks

1。您是否尝试将问题分解为较小的问题并搜索解决方案?

2.如果是,到目前为止尝试了什么?

3.如果有,你在哪里被困?

4.如果你卡住了,那是什么问题?



我想,你没试过这个。



如果你希望别人为你工作,你将不会学到任何东西。

你可以试试一开始就是你自己的东西,当你卡在任何地方时,来自这里的任何人都会竭尽全力帮助你。但不要直接询问源代码



阅读代码项目快速解答常见问题解答 [ ^ ]首先:)





-KR
1. Did you try to break your issue down into smaller ones and search for the solution ?
2. If yes, what have tried so far ?
3. If you have, where did you stuck ?
4. And if you stuck, what's that issue ?

And I assume, you didn't try any of this.

"You won't be learn anything, if you expect others do your work for you".
You can try something on your own at first and when you stuck anywhere, anyone from here would do his/her best to help you out. But don't directly ask for the source code.

Read the Code Project Quick Answers FAQ[^] first :)


-KR


一次又一次地回答这么多问题是不好的: HTTP:// WWW。 codeproject.com/search.aspx?q=%28%22.NET%22+OR+%22C%23%22+OR+%22VB.NET%22%29+SQL+%28image+OR+pictures+OR+bitmaps%29&amp ; doctypeid = 1%3b2%3b3%3b13%3b14 [ ^ ]。



此外,在许多情况下,例如网站/应用程序中使用的图像,最好将图像存储在服务器中 - 副文件系统;然后他们应该有一些独特的文件名; SQL用于存储名称,这将使数据库的使用更加高效。



-SA
It would be not good to answer again and again to the question asked so many times: http://www.codeproject.com/search.aspx?q=%28%22.NET%22+OR+%22C%23%22+OR+%22VB.NET%22%29+SQL+%28image+OR+pictures+OR+bitmaps%29&doctypeid=1%3b2%3b3%3b13%3b14[^].

Also, in many cases, such as the images used in a Web site/application, it can be better to store the images in the server-side file system; then they should have some unique file names; and the SQL is used for storing just names, which would make database use way more efficient.

—SA