I am attempting to stream data from a database, to a file. Everything is working good, until you click "Open" on the browsers "Do you wish to open or save this file" dialog box. When you click open, the browser appears to download the file, then the associated application tries to open the file, then I get the error attached.
I am not sure how to code this so that the file opens without a sharing violation.
This only happens in Internet Explorer (Version 7)
The file opens successfully in Firefox and Google Chrome.
var buffer = (byte)dsData.Tables.Rows;
Response.ContentType = "application/EDI.Document";
Response.AddHeader("content-disposition", "attachment; filename=file.edi");