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.
 
Top