本文介绍了OLEDB中的问题优于阅读的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I'm reading data from Excel through OledbConnection. Here data are reading sometimes perfectly but sometimes it is missing to read some data.

Example :

In Excel ,I have 79 columns in excel and 4 rows , first 2 rows are headers so after import i'll delete that rows and actual data starts from 3, so here i have only one row.
After Reading through oledb, that dataset's datatable has only first 2 rows(2 row only in datatable, its ignoring 3rd and 4th row)


Row1     A    B    C    D    E     .....

Row2    AA    BB    CC    DD    EE    ....

Row3    a    a    a    aa    a    ...  ( Actual Data starts here )

Row4    b    b    b    bb    b    ...


After importing through Oledb, datatable has only first 2 rows(Header which is in excel template) , 3rd and 4th row is missing.





什么我试过了:



我的连接字符串是



Provider = Microsoft.ACE。 OLEDB.12.0;数据源= filePath;扩展属性= \Excel 12.0; HDR =是; IMEX = 1; Importmixedtypes = text; typeguessrows = 0;



What I have tried:

My connection string is

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=filePath;Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=1;Importmixedtypes=text;typeguessrows=0;

推荐答案


这篇关于OLEDB中的问题优于阅读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 17:59