0

Something related to this question might have been asked but not the issue I am facing.My connectionstring looks like this

Provider=Microsoft.Jet.OLEDB.4.0;Data Source="F:\TSData\Case 5262";
Extended Properties='text;HDR=No;FMT=Delimited';

I have a delimited text file with 2 lines of data and no header row but the first row is not read at all. If I have header row then both the lines are read.

Can anyone suggest a way to read all the rows from a file with no header row.

Ameya Deshpande
  • 3,580
  • 4
  • 30
  • 46
hima
  • 610
  • 3
  • 10
  • 24
  • How are you selecting your data? http://stackoverflow.com/questions/23570128/why-isnt-the-ado-extended-properties-hdr-no-flag-being-obeyed-here is possibly related. – Jeroen Mostert Mar 02 '15 at 13:37
  • It is related thanks, but data is read differently. I am using OleDbConnection and OleDbCommand which fails at connection.Open() if I specify entire path in connectionString. – hima Mar 02 '15 at 14:19
  • @Jeroen Mostert I encounter this problem if I follow the solution http://stackoverflow.com/q/1458068/2459982 – hima Mar 02 '15 at 14:38

1 Answers1

0

try specifying your Delimiter instead of ',' in connection string and check

Provider=Microsoft.Jet.OLEDB.4.0;Data Source="F:\TSData\Case 5262";
Extended Properties='text;HDR=No;FMT=Delimited(,)';

https://www.connectionstrings.com/textfile/

Lokesh B R
  • 272
  • 1
  • 8