Search code examples
c#exceloledb

How can I read only first row from an Excel file with OleDbDataAdapter?


Can anybody help me? How can I read only first row from an Excel file with OleDbDataAdapter?

I know how I can read all data from any spread sheet:

var dataAdapter = new OleDbDataAdapter("SELECT * FROM [" + sheetName + "$]", oledbConnection);

But I don't know how can I do this for one row.


Solution

  • select top 1 * from ...