我有插入图像到数据库sql server的问题 [英] i have problem with inserting image to database 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屋!