SQL FileStream 打开 XPS 文件
我正在尝试使用 Filestream 属性读取已插入数据库的 XPS 文件。到目前为止,这是我的代码。
RewardsDataContext dx = new RewardsDataContext();
var img = (from c in dx.RwProductsTests
select c).FirstOrDefault();
byte[] buffer = img.Blob.ToArray();
MemoryStream ms = new MemoryStream();
ms.Write(buffer, 0, buffer.Length);
ms.Position = 0;
Package package = Package.Open(ms, FileMode.OpenOrCreate, FileAccess.ReadWrite);
XpsDocument MyDoc = new XpsDocument(package);
dv1.Document = MyDoc.GetFixedDocumentSequence();
dx.Dispose();
我收到以下错误。 XpsDocument URI 为空。使用采用 URI 参数的 XpsDocument 构造函数。
I am trying to read an XPS file that I have inserted into my database using the Filestream attribute. Here is my code thus far.
RewardsDataContext dx = new RewardsDataContext();
var img = (from c in dx.RwProductsTests
select c).FirstOrDefault();
byte[] buffer = img.Blob.ToArray();
MemoryStream ms = new MemoryStream();
ms.Write(buffer, 0, buffer.Length);
ms.Position = 0;
Package package = Package.Open(ms, FileMode.OpenOrCreate, FileAccess.ReadWrite);
XpsDocument MyDoc = new XpsDocument(package);
dv1.Document = MyDoc.GetFixedDocumentSequence();
dx.Dispose();
and I get the following error.
XpsDocument URI is null. Use XpsDocument constructor that takes URI parameter.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论