oledbexception - Microsoft.Jet.OLEDB.4.0 error on Azure Cloud Service -
my requirement upload excel file folder on website root , read file's data datatable.
this working fine on existing hosting provider. i've uploaded website on windows azure cloud service. after porting azure cloud service i'm getting error on "microsoft.jet.oledb.4.0" provider.
i have use “microsoft.jet.oledb.4.0” provider read data excel file , add data datatable. work fine on local too, when host web application on azure cloud service generate following error
“microsoft.jet.oledb.4.0 provider not registered on local machine”
please have on line of codes:
string strpath = server.mappath(oapppath); strpath = strpath + "\\mydatafolder\\" + system.io.path.getfilename(fileupload1.postedfile.filename); fileupload1.postedfile.saveas(strpath); string excelconnectionstring = ""; excelconnectionstring = "provider=microsoft.jet.oledb.4.0;" + "data source=" + strpath + ";extended properties=\"excel 8.0;;imex=1;hdr=yes\""; var connection = new oledbconnection(excelconnectionstring); connection.open(); var dtsheets = new datatable(); dtsheets = connection.getoledbschematable(oledbschemaguid.tables, null); gc.collect(); gc.waitforpendingfinalizers(); what alternate solution of this?
i looked on following too:
thanks kapil
this caused because application running on 64 bits mode. according microsoft, the microsoft ole db provider jet , microsoft access odbc driver available in 32-bit versions only.
as described in how x64 version of jet?:
the microsoft jet database engine 4.0 components entered state of functional deprecation , sustained engineering, , have not received feature level enhancements since becoming part of microsoft windows in windows 2000.
one alternative use startup task in cloud service deploy microsoft access database engine 2010 redistributable. you'll have change connection string formats supported new driver.
another approach, have used success, use library such exceldatareader read spreadsheet data.
Comments
Post a Comment