Exporting Data to Excel using Office Web Components (OWC) in ASP.NET

  • Thread starter Silvia Brunet Jones
  • Start date
S

Silvia Brunet Jones

I have the following cod
********************
SqlDataAdapter sqlAdapter = new SqlDataAdapter()
sqlAdapter.SelectCommand = cmd
SqlDataReader reader = cmd.ExecuteReader()
int numbercols = reader.FieldCount;
int row=1;
while (reader.Read())

for (int i=0;i<numbercols;i++)
{
xlsheet.ActiveSheet.Cells[row,i+1] = reader.GetValue(i).ToString()

row++
}
reader.Close()
sqlConnRes = objSQL.CloseSQLconn(sqlConnRes)
cmd.Dispose()
xlsheet.ActiveSheet.Export("\\\\net_serv\\datarepository\\Templates\\Excel\\test.csv",OWC.SheetExportActionEnum.ssExportActionNone)

********************
When executed I keep getting this error eventhough I have mess with the security rights off this folder. I have no idead to what specific user is wanting the security right for. Please HEL

Exception from HRESULT: 0xE004002A.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Exception from HRESULT: 0xE004002A.
 

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