Here is the answer:
http://msmvps.com/blogs/nickwienholt/archive/2006/03/15/86379.aspx
On 27 Aug, 15:19, stapes <[EMAIL PROTECTED]> wrote:
> Hi
>
> I am trying to import an excel spreadsheet using the following:
>
> string theFileName = this.txtUploadedFile.Text;
>
> string strConn;
> strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" +
> "Data Source=" + theFileName +
> ";Extended Properties=Excel 8.0;";
> //You must use the $ after the object you reference in
> the spreadsheet
> OleDbDataAdapter myCommand = new
> OleDbDataAdapter("SELECT * FROM [" + wSheet + "]", strConn);
>
> DataSet myDataSet = new DataSet();
> myCommand.Fill(myDataSet, "ExcelInfo");
>
> It seems to be working OK, but it is randomly omitting field
> values.i.e. My input spreadsheet has values
> 1, CT, 10/01/2008, YES
>
> The imported array has
> ,CT,,YES
>
> Why is it randomly ignoring some data?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web
Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---