Excel data import problem

  • Thread starter msnews.microsoft.com
  • Start date
M

msnews.microsoft.com

Hi friends,

First of all sorry for my not very good English.

I have very strange problem, I have to import a data from excel sheet. I
have 10 columns and all the data is coming properly except the data from one
column. The data from this column is ok if it is some string but if the data
is int the data just doesn't appear.

I think it is some kind of formatting of the column of excel file but I did
not find anything.

Please if possible help me to solve the problem
 
M

Mark Rae

Please if possible help me to solve the problem

It's almost impossible to help you if you don't at least show us:

1) the code you're using

2) the error message

3) the line which generates the error
 
A

Aron.B

That is my code, but I think the problem is not in my code.



Dim cnExcel As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source = " & sFile & ";Extended Properties=Excel 8.0;")

cnExcel.Open()

Dim cmdExcel As New OleDbCommand("SELECT * FROM [" &
lookup.Rows(0)("TABLE_NAME") & "]", cnExcel)



Dim objAdapter1 As New OleDbDataAdapter

objAdapter1.SelectCommand = cmdExcel

Dim objDataset1 As New DataSet

objAdapter1.Fill(objDataset1, "XLData")



DataGrid1.DataSource = objDataset1

DataGrid1.DataBind()











I can see all the columns with all the data except the data from one of the
columns. And the strange think is that if I change the data in this column
from int to string, it is working perfect.

There is no error, just the data is not appear



Any ideas?

Thanks in advance
 
S

sloan

At the least.. after you line:

objDataset1

find the objDataset1.GetXml()

and examine it in nodepad.exe . That will help ....

You need to decouple the DataSet get, and the Bind() method to see which one
is killing it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top