如何将图像保存到mysql数据库 [英] How to save images to the mysql database

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

问题描述

你好,

我在asp.net mvc3应用程序上开发一个项目.我正在将图像保存到数据库mysql中.在mysql中,我正在使用blob数据类型来保存图像.我正在工作两天.我在互联网上找不到任何解决方案.所以请提供任何建议或任何示例代码.我使用实体模型连接到数据库.因此,我不需要任何连接字符串即可连接到数据库.使用实体模型对象dbcontext,我可以检索数据库中的列.建议或示例代码,请

问候
Prasanna Kumari

Helo,

Iam developing a project on asp.net mvc3 application.Iam working on saving images to the database mysql.In mysql am using blob datatype to save the images .Iam working for two days .I am not finding any solution in the internet.So please provide any suggestions or any sample code.Iam using entities model to connect to the database.So i dont need any connection string to connect to the database.With entities model object dbcontext i can retrieve the columns in the database.So please provide me any suggestions or sample code please

Regards
Prasanna Kumari

推荐答案

亲爱的

首先将列的数据类型用作图像.
然后将图像字节作为
hi dear

first Use the datatype of column as image.
then pass image byte as
DBType.Binary

数据类型从存储过程传递到数据库并将其插入.

这肯定会起作用.

问候

datatype from Stored Procedure to Database and insert it.

This will work surely.

Regards,


查看这些链接,您可能会有所了解

http://forums.asp.net/t/1679447.aspx/1 [ ^ ]

http://stackoverflow.com/questions/7260638/asp-net-mvc3-upload-image-and-保存到数据库 [ ^ ]

http://stackoverflow.com/questions/6369979/how-to- display-image-in-asp-net-mvc3 [ ^ ]
see these links you may get some idea

http://forums.asp.net/t/1679447.aspx/1[^]

http://stackoverflow.com/questions/7260638/asp-net-mvc3-upload-image-and-save-it-to-database[^]

http://stackoverflow.com/questions/6369979/how-to-display-image-in-asp-net-mvc3[^]


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

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