Trouble pulling data from Excel file
- From: "eclipx" <u37193@uwe>
- Date: Wed, 05 Sep 2007 21:01:29 GMT
I am trying to pull rows from an Excel file into a dataset. The Excel file
is a long list of customer names, addresses, phone numbers, etc. I thought
everything was working great. It looked like the rows had all imported into
the dataset, but then (seemingly at random) certain rows were missing data.
The majority of each row's data is there but zip codes are missing in my
dataset and clearly available in the Excel file. So far is seems that the
zip code column is all that is affected. I haven't taken too close a look at
any other fields. My code for importing Excel file data into a dataset is
listed below. In order to view this data, I set a datagridview's datasource
property to ExcelDataSet.Tables(0). If you need me to send one of the files
I am working with so you can better reproduce this problem, let me know what
email address to send it to. Thanks for any help you can provide. I am
completely stumped by this problem.
Private Sub LoadFile(ByVal worker As BackgroundWorker)
If remExcelFileName > "" Then
If remExcel*** > "" Then
ExcelDataSet = New DataSet
ExcelDataAdapter = New OleDb.OleDbDataAdapter("SELECT * FROM
[" & remExcel*** & "]", conn)
Try
ExcelDataAdapter.Fill(ExcelDataSet)
Catch ex As Exception
MsgBox(ex.Message)
Exit Sub
End Try
Else
MsgBox("You must select an Excel *** to load. ",
MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "Excel *** Selection
Required")
End If
Else
MsgBox("You must select an Excel File to load. ",
MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "Excel File Selection Required")
End If
End Sub
.
- Follow-Ups:
- Re: Trouble pulling data from Excel file
- From: Dblood
- Re: Trouble pulling data from Excel file
- From: Nathan Sokalski
- Re: Trouble pulling data from Excel file
- Prev by Date: Re: Receive Email with VB2005?
- Next by Date: Re: Receive Email with VB2005?
- Previous by thread: Receive Email with VB2005?
- Next by thread: Re: Trouble pulling data from Excel file
- Index(es):
Loading