943,553 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 1978
  • ASP.NET RSS
Sep 2nd, 2008
0

Help to read the excel file.

Expand Post »
Here i am attatching the source code and the excel file. When i use this code it generates the error , "The external table is not in correct format'.

Code:
asp.net Syntax (Toggle Plain Text)
  1. private string StrConn = "";
  2. OleDbDataAdapter da;
  3. DataSet ds = new DataSet();
  4. StrConn = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filePath + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=1\"";
  5. da = new OleDbDataAdapter("SELECT [Response Code], [Transaction ID] FROM [Download20080831-112615$]", StrConn);
  6. da.Fill(ds);
  7. }


If you want to test i have also attatched the excel file in zip filder that i am using
One thing however this working to read any other excel file.
Please if someone has any idea help me.
Attached Files
File Type: zip File.zip (108.5 KB, 49 views)
Last edited by peter_budo; Sep 2nd, 2008 at 7:32 am. Reason: Keep It Organized - please use [code] tags
Similar Threads
Reputation Points: 8
Solved Threads: 0
Junior Poster in Training
FaridMasood is offline Offline
59 posts
since Mar 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Retaining checkbox values during paging
Next Thread in ASP.NET Forum Timeline: How to use serach tools on my local Intraweb





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC