Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all articles
Browse latest Browse all 1350

OdbcConnection Microsoft Excel Driver reading only first row first column

$
0
0

My C# code is working for an excel file and is reading all lines but for another file it is reading only first row and first column. Connection String:

sConnStr1 = "Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};Dbq=" + info1.FullName + ";DefaultDir=" + info1.Directory + ";";

Code:

System.Data.Odbc.OdbcConnection conn;DataTable dt1 =newDataTable();System.Data.Odbc.OdbcDataAdapter da;string file = sFilePath;
        conn =newSystem.Data.Odbc.OdbcConnection(sConnStr1);
        da =newSystem.Data.Odbc.OdbcDataAdapter(sDAstr1, conn);
        da.Fill(dt1);

Can someone please guide me. This is last problem I am facing to complete my application.


Viewing all articles
Browse latest Browse all 1350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>