473,468 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Reading Excel via ADO.Net: IMEX=1 ignored when HDR=Yes

I noticed that when I tried to use ADO.Net to read an Excel workbook
(actually a Named Range called Data) that includes headers (thus HDR=Yes), I
notice that a purely numeric value in the first column is treated as a
Double, despite being told (via IMEX=1) to treat all columns as Text.

Is this a bug? Broken As Designed (B.A.D.)? Or am I not interpreting the
meaning of IMEX=1 correctly (W.A.D.)?

My only work-around was to open up the Excel workbook, put an 'X' in front
of the number in the first nine rows, add code to strip it back out
(stringVar.Remove(0,1)), which seemed to fool ADO.Net into treating the
column as pure Text instead of a Double.

A portion of the connect string: Extended Properties="IMEX=1;HDR=Yes;"
Nov 20 '05 #1
1 10716
Cor
Hi Fred,

If you not get a proper anser here about this connection string, you can
maybe ask it in the newsgroup
microsoft.public.dotnet.framework.adonet

Cor
I noticed that when I tried to use ADO.Net to read an Excel workbook
(actually a Named Range called Data) that includes headers (thus HDR=Yes), I notice that a purely numeric value in the first column is treated as a
Double, despite being told (via IMEX=1) to treat all columns as Text.

Is this a bug? Broken As Designed (B.A.D.)? Or am I not interpreting the
meaning of IMEX=1 correctly (W.A.D.)?

My only work-around was to open up the Excel workbook, put an 'X' in front
of the number in the first nine rows, add code to strip it back out
(stringVar.Remove(0,1)), which seemed to fool ADO.Net into treating the
column as pure Text instead of a Double.

A portion of the connect string: Extended Properties="IMEX=1;HDR=Yes;"

Nov 20 '05 #2

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

Similar topics

3
by: Mads Petersen | last post by:
I'm stuck in this code. Hope you can and will help me. I launch it from excel. I have made the following code work, but not as i whant. I need the ranges to be working with something like xlDown....
3
by: hkappleorange | last post by:
I connect to mdb file using the following codes. How should I modify it if I want to connect to Excel instead ? <%@ Import Namespace="System.Data.OleDb" %> <% Dim conAuthors As...
5
by: Li Pang | last post by:
I use sql to get the data from a Excel file. It works only when the data within a column have the same data type. I'd like to know how to change the data format for each column (adding "'" for...
4
by: Michael C# | last post by:
Hi all, I have a little program that uses OleDb to open and read an Excel spreadsheet from VB.NET. The problem I'm running into is it's not reading the column headers... The Excel worksheet...
1
by: dave | last post by:
I am having a problem i bleieve a number of other individuals have had before. I have tried the solutions found on the net however I still have the problem. I am hosting a web site on an...
1
by: ShailShin | last post by:
Hi All, I have to convert Excel data to MSAcess .MDB file using VB.NET. VB.NET Code read the Excel file and write it to .MDB file. For the same I have below code, but I am stuck at the writing it...
1
by: =?Utf-8?B?S3VtYXIuQS5QLlA=?= | last post by:
I am having a problem in reading the values from the excel sheet in ASP .Net. I am using the following connection string to read values from rows from an excel sheet into a dataset. One of the...
18
by: PW | last post by:
Convert them to CSV in Excel, then use TransferText (which does not work correctly and also doesn't accept XLS/Excel files directly) or create a link to an Excel XLS workbook and do an Append Query...
8
by: Joe Duchtel | last post by:
Hello - I have the following code to detemine a file name when my application is saving a file. The problem is that if the file already exists and I select the Yes button in the "Do you want to...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.