By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,992 Members | 934 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,992 IT Pros & Developers. It's quick & easy.

E_FAIL(0x80004005) error with Excel import

P: 18
I am trying to do Excel Import with Oledb. It is working fine in my local machine. But when i upload it to live server, getting the below given error:

E_FAIL(0x80004005)

Any help will be appreciated. I have attached my code below,
__________________________________________________ ______

OleDbConnection ConExcl = new OleDbConnection();
string sConExcl = string.Empty;

sConExcl = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fileName + @";Extended Properties=""Excel 8.0;HDR=Yes;""";

ConExcl.ConnectionString = sConExcl;
ConExcl.Open();

//This gets the all the excel sheet records in a data table
System.Data.DataTable tblCategory = new System.Data.DataTable("Category");
System.Data.OleDb.OleDbDataAdapter daSelect = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", ConExcl);
daSelect.Fill(tblCategory);
May 24 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.