COMException occurs while creating Excel from generic list

A

Abhijeet

Hello Friends,

I am developing web application using ASP.Net 2.0 C# , i am working on one
requirement from client, hence as per the requirement i am writing the data
fetched from ORACLE DB to the EXCEL(2007) sheet. To generate this excel i am
using GenericList<> as data object. And the rows could be more than 10k. But
while acheiving this i am getting the mentioned error on my machine i.e. on
local machine.

The code to write excel sheet is given below -

Workbooks workbooks;
workbooks = oXL.Workbooks;

_Workbook workbook;
workbook = workbooks.Add(XlWBATemplate.xlWBATWorksheet);

Sheets sheets;
sheets = workbook.Worksheets;

_Worksheet worksheet;
worksheet = (_Worksheet)sheets.get_Item(1);
worksheet.get_Range("A2",
System.Reflection.Missing.Value).CopyFromRecordset(vzmLst, vzmLst.Count,
colCount); // Here the error occurs
System.Runtime.InteropServices.COMException (0x800A03EC)



Thanks and Regards,

Abhijeet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top