将图像存储在sql server中 - ASP.NET
答
假如你需要保存图像本身,而不是路径,你可以这样做:
FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
byte[] image = br.ReadBytes((int)fs.Length);
,然后发送字节到数据库。
http://stackoverflow.com/questions/15659835/how-to-store-image-in-sql-server-database-tables-column check this – Anuj 2013-05-08 11:34:53