【发布时间】:2014-11-08 01:38:29
【问题描述】:
有没有办法将从 sql server 返回的字节数组转换为 c# 中的流对象? 我希望能够在下面做这样的事情
FileStream fs = new FileStream(@"C:\Users\sample\sample\sample.txt", FileMode.Open, FileAccess.Read);
fs.Seek(0, SeekOrigin.Begin);
BinaryReader br = new BinaryReader(fs);
Byte[] bytes = br.ReadBytes((Int32)fs.Length);
//bytes array will be saved in the database
//The following will be returned from the database and i need it to be in a stream
Stream s = (Stream)bytes;
除了 varbinary(MAX) 格式之外,还有其他方法可以将其保存在 sql server 中吗?
【问题讨论】:
标签: c# sql sql-server