문제

I am trying to understand how to correctly load a large file into a database. I understand how to get the file from the database and stream it back without using too many resources by using a DataReader to read into a buffer and then writing the buffer to the OutputStream.

When it comes to storing the file all of the examples I could find read then entire file into a byte array and then supply it to a data parameter.

Is there a way to store the file into a database without having to read then entire file into memory first?

I am using ASP.NET and Sql Server

도움이 되었습니까?

해결책

If you can use .Net 4.5, there is new support for streaming. Also, see Using ADO's new Async methods which gives some complimentary examples.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top