0
如何将图像从Image Control保存到SQL Server?我没有上传该图片,但是我通过网络摄像头捕获并在图像控件上显示。将图像存储在sql server中 - ASP.NET
如何将图像从Image Control保存到SQL Server?我没有上传该图片,但是我通过网络摄像头捕获并在图像控件上显示。将图像存储在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