如何使用C#将图像保存在数据库中 [英] How to save image in database using C#
本文介绍了如何使用C#将图像保存在数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想用 C# 将用户图像保存到数据库中.我该怎么做?
I want to save user image into a database in C#. How do I do that?
推荐答案
您需要将图像序列化为可以存储在 SQL BLOB 列中的二进制格式.假设您使用的是 SQL Server,这里有一篇关于该主题的好文章:
You'll need to serialize the image to a binary format that can be stored in a SQL BLOB column. Assuming you're using SQL Server, here is a good article on the subject:
http://www.eggheadcafe.com/articles/20020929.asp
这篇关于如何使用C#将图像保存在数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文