Statistics

Total Posts: 34
This Year: 0
This Month: 0
This Week: 0
Comments: 174


RSS 2.0   SocialTwist Tell-a-Friend


Admin

Sign In

Navigation


Recent Posts


On this page....


Archives

 Full Archives By Category
 2007 Calendar View
<March 2010>
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Categories

CDOSYS (1) Classic ASP (10) Command Line (2) Databases (16) Excel (1) HTML (1) IIS (10) Indexing Service (1) Internet Explorer (7) Media Streaming (1) MS.Net (2) SQA (7) SQL Server (16) Windows OS (2)

Blogroll - Fav Blogs


Acknowledgments

DasBlog Theme Design by: Tom Watts
E-mail: Send mail to the author(s)
Theme Image by: dreamLogic

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

Technology Blog

Many developers/programmers while writing code to extract data from an excel Intermixed data columns struggle to read the data. Reading data from an excel file is always been a challenge as the first row (record) of the data in excel defines the data type of the column. For example if the first row has the data as Integer and any consecutive row has the data as Float, excel read operation would fail as it expects the rest of the data in that column to be of Integer type. When a column has data of different data type is called as Intermixed Data Columns.

Now the question is that how to read excel data from a column having Intermixed Data Types; the answer is that we read all the data as TEXT type.  You can build connection for an excel file using the below code:

Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\MyExcel.xls; Extended Properties="Excel 8.0;HDR=Yes; IMEX=1";

The Extended Property IMEX set to 1 tells the driver to always read Intermixed Data Columns as TEXT. Also note that HDR set to YES means that the first row in the excel file is the column header.

Classic ASP | SQA | Excel | MS.Net
All comments require the approval of the site owner before being displayed.
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, strike, strong, sub, sup, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview