Help to read the excel file.

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2007
Posts: 59
Reputation: FaridMasood is an unknown quantity at this point 
Solved Threads: 0
FaridMasood's Avatar
FaridMasood FaridMasood is offline Offline
Junior Poster in Training

Help to read the excel file.

 
0
  #1
Sep 2nd, 2008
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:
  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.
Last edited by peter_budo; Sep 2nd, 2008 at 7:32 am. Reason: Keep It Organized - please use [code] tags
Attached Files
File Type: zip File.zip (108.5 KB, 5 views)
Thanks and Best of Lusk,

Farid ud din Masood
MS.c (CS)
University of Agriculture, Faisalabad
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC