How to serve a View as CSV in ASP.NET Web Forms

Posted by ChessWhiz on Stack Overflow See other posts from Stack Overflow or by ChessWhiz
Published on 2010-03-29T18:38:06Z Indexed on 2010/03/29 18:43 UTC
Read the original article Hit count: 301

Filed under:
|
|
|
|

Hi,

I have a MS SQL view that I want to make available as a CSV download in my ASPNET Web Forms app. I am using Entity Framework for other views and tables in the project. What's the best way to enable this download?

I could add a HyperLink whose click handler iterates over the view, writes its CSV form to the disk, and then serves that file. However, I'd prefer not to write to the disk if it can be avoided, and that involves iteration code that may be avoided with some other solution. Any ideas?

© Stack Overflow or respective owner

Related posts about aspnet

Related posts about csv