473,387 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Excel data import problem

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
Jun 26 '06 #1
3 950
"msnews.microsoft.com" <ya*****@yahoo.com> wrote in message
news:eR*************@TK2MSFTNGP05.phx.gbl...
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
Jun 26 '06 #2
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
Jun 26 '06 #3

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.


"Aron.B" <d.********@cergis.com> wrote in message
news:OQ*************@TK2MSFTNGP03.phx.gbl...
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

Jun 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Richard Holliingsworth | last post by:
Hello: Thanks for your quick response. I'm trying to import a new Excel file into an A2K table and it's truncating the data. One of the Excel columns is a text field that can be up to 2000...
2
by: Fred | last post by:
Hi. How do I import while mapping an excel table to an access table please??? I've searched around and all I can find is a software product or code that does the same thing as the access...
9
by: jillandgordon | last post by:
I am trying to import an excel file into Access 97. It looks perfectly all right but, every time I try to import it, I get to the lst step and am told that it was not imported due to an error. ...
2
by: Siu | last post by:
Hi, I use the following code to export and import a file Excel from resp. into a Web page with the following code: //EXPORT Response.Clear(); Response.Buffer = true; Response.ContentType =...
2
by: madeleine | last post by:
I'm hoping the answer to this is that I'm just doing something silly, but I'm really scratching my head over this one. I'm importing data from multiple workbooks, each workbook has a sheet called...
0
by: Grip | last post by:
Hi, I have gone throught the group and Microsoft's online help and have seen many suggestions but I am still seeking clarity: 1. I have an excel spreadsheet. Column A contains text that may...
6
by: oyk | last post by:
I hope someone could help me on this. I have linked an excel worksheet to access but the some data shown in the access table has the #Num errors. Presumably, this must be because the data in the...
4
by: somanyusernamesaretakenal | last post by:
What I am trying to achieve: Basically I have generated a report in access. This report needs to be updated using excel. (Updating the new data, not changing existing data) What I did was I...
0
by: liam_jones | last post by:
I'm very new to Python, well IronPython to precise, and have been having problems when using Excel. The problem I'm having is the closing of my Excel object. I'm able to successfully quit the...
7
by: TG | last post by:
hi! I am trying to create a sql server table from an excel sheet. Here is the code I have: 'This procedure the xlsx file and dumps it to a table in SQL Server
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.