将图像和文本一起存储在MSSQL数据库中 [英] Store image and text together in MSSQL database

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

问题描述

您好,



我的实际问题是我想将图像和文本存储在表'tblTest'中的单列字段中。



场景:



我通过用户输入了以下数据:



根据下图,你可以说这个图有更绿的颜色,一个人住在这个绿色的宫殿里。



test.jpg(假设你在这里有一些图片)





解释上图。







现在我想在表格tblTest的数据库字段的富文本框中输入以上数据。



是否可以将图像和文本存储在单列中,如果有,任何人都可以告诉我哪种数据类型适合它。

以及如何从数据库中再次检索它。



谢谢,

解决方案

可能这篇关于存储序列化的文章数据到SQL会帮助你。



http://aspalliance.com/1093_Serialization_in_Database .a [ ^ ]



您可以使用 Image String 创建一个类并使其 [Serializable] 并插入此序列化数据,如文章链接所示。



并检索并将序列化数据转换回原始类

Hello,

My actual problem is i wanted to store image and text both in single column field in table 'tblTest'.

Scenario:

I have a following entered data by user:

According to following diagram you can say that this diagram has a more greenery color, and one man is living in this green palace.

test.jpg (assume that you have some image over here)


Explain above diagram.



And now i want to store above enter data in rich text box at database field of table tblTest.

Whether it is possible to store image and text in single column if yes can anybody tell me which data type is suitable for it.
And how to retrieve it again from database.

Thanks,

解决方案

Probably this article on Storing Serialized data to SQL will Help you.

http://aspalliance.com/1093_Serialization_in_Database.a[^]

You could make one class with Image and String and make it [Serializable] and insert this serialized data as performed with article link.

and retrieve and cast that serialized data back to original class.


这篇关于将图像和文本一起存储在MSSQL数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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