我有插入图像到数据库sql server的问题 [英] i have problem with inserting image to database sql server

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

问题描述

朋友们。



我在数据库中插入图片时遇到问题。我的数据库列类型是图像,当我想在数据库中输入图像时,一些数据在数据库中恢复,但它只有13个字节,而我的图像长度是35155个字节。在我的插入命令行中,我放置了一个断点,我可以看到我要保存的是什么,它的长度是正确的(35155字节)但是当我去(SSMS)时,我看到那里只存储了13个字节。或者当我想从数据库中检索数据时,我看到从数据库中检索的内容只有13个字节。怎么了?



谢谢。

解决方案

您需要使用参数化语句。这里有几篇关于它的文章和技巧。



这是一个:将图像加载到DB表中或从DB表中卸载图像 [ ^ ]


我会 Google for the [ ^ ]。

hi friends.

i have a problem with inserting image in database. my database column type is image and when i want to enter image in database some data restore in database but it is only 13 bytes whereas my images length is 35155 bytes. in my insert command line i placed a break point and i can see that what is i want to save,it's length is correct(35155 bytes) but when i go to (SSMS) i see that only 13 bytes stored in there. or when i want to retrieve data from database i see that what retrieved from database is only 13 bytes. what is wrong?

thank you.

解决方案

You need to use a parameterised statement. There are several articles and tips here on CP that cover it.

Here's one: Load/Unload images into/from DB table[^]


I would Google for that[^].


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

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