i am trying to use commands like Response.ClearContent() and Response.Write() to export a datatable to Excel however visual studio is not recognizing the Response keyword. is there a using statment associated with these commands? Because i’m obviously missing something. thanks
i am trying to use commands like Response.ClearContent() and Response.Write() to export a datatable
Share
Response is a property of type HttpResponse in the Page class.
.ClearContent()and.Write()are instance methods of type HttpResponse.I cannot see how you expect to use this to write a datatable to excel (unless I am vastly overlooking something). By all means you could use Response to write the content of a datatable to a webpage, however to write to excel you may need a third party library, or some other functionality…http://www.codeproject.com/Articles/8411/C-class-library-for-exporting-data-to-CSV-Excel-fi