Last post Jan 20, 2013 03:38 AM by amrremah
Jan 15, 2013 06:08 AM|amrremah|LINK
Good evening everybody,
I am struggling updating an excel file through OleDb in an ASP.net website.
I could perfectly read the excel file with no problems whatsoever. However, I could not update it at all, my function returns no errors but it does not update the file!
I have created a dummy application to test my function and my code is as follows:
OleDbCommand myCmd = new OleDbCommand("update [PL$] set ZoneID='Test'", new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + @"C:\inetpub\wwwroot\ExcelTestApp\mySheet.xlsx" + ";" + "Extended Properties=\"Excel 12.0 Xml;HDR=YES;ReadOnly=False;\""));
I have tested the code above in a console application and it is working perfectly. However, It never works in an ASP.net application.
The configuration of my development server is as follows:
Windows Server 2008 R2
Access Database driver 2010 x86
My application pool is configured to run in 32-bit mode.
Amr R. Kamel
Jan 15, 2013 06:14 AM|mayank arora|LINK
use this link:
Jan 15, 2013 06:26 AM|amrremah|LINK
Thank you Mayank for your response. However, the connection string provided in the link only works with old "xls" files and correctly updates them, but it does not work with excel 2007 files ".xlsx", throws an exception "External table is not in the expected
Jan 20, 2013 03:38 AM|amrremah|LINK