使用C#将图像和数组保存到SQL Server [英] Save image and array in to SQL server using C#

查看:75
本文介绍了使用C#将图像和数组保存到SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用C#将图像和数组(与特定图像像素相关的数组)插入到SQL服务器中。



赞,

DB表中有两列,一列用于图像,另一列应该包含该列。



请建议一些方法来实现这一点,这对我很有帮助!

I want to insert an image and array (that array related to particular image pixels)in to SQL server using C#.

Like,
There are two columns in DB table, one for image, and other one should consists that array.

Please suggest some way to accomplish this,it would be very helpful to me!

推荐答案

有看看这里:为什么我会得到参数无效。我从数据库中读取图像时出现异常? [ ^ ] - 它涵盖了这样做。
Have a look here: Why do I get a "Parameter is not valid." exception when I read an image from my database?[^] - it covers doing exactly that.


再次回答是不好的这个问题已经回答了很多次: http://www.codeproject.com/search.aspx?q=%28%22.NET%22+OR+%22C%23 %22%29 +数据库+%28image + OR +图像+ OR +位图+ OR +位图%29 [ ^ ]。



此外,在许多情况下,最好将图像文件存储在文件系统中,并仅在数据库中存储(相对)文件名。例如,对于网站/应用程序来说这将是一种更好的方法。



-SA
It would be bad to answer again and again the question which has been answered so many times: http://www.codeproject.com/search.aspx?q=%28%22.NET%22+OR+%22C%23%22%29+database+%28image+OR+images+OR+bitmap+OR+bitmaps%29[^].

Also, in many cases, it's better to store the image files in file system and store only the (relative) file names in your database. For example, it would be a better approach for Web sites/applications.

—SA


这篇关于使用C#将图像和数组保存到SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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