Questions tagged [exceldatareader]

Questions about ExcelDataReader, a .NET library for reading Microsoft Excel files. When using this tag, also tag the question with the programming language being used unless your question is not specific to any programming language.

ExcelDataReader is a lightweight and fast .NET library written in C# for reading Microsoft Excel (97 and newer) files.

Cross-platform:

  • Windows with .Net Framework 2
  • Windows Mobile with Compact Framework
  • Linux, OS X, BSD with Mono 2+

Project page at CodePlex: http://exceldatareader.codeplex.com/

Latest sources available at GitHub: https://github.com/ExcelDataReader/ExcelDataReader

For more information read its Read-Me file at GitHub.

141 questions
76
votes
1 answer

VS Code C# - System.NotSupportedException: No data is available for encoding 1252

I am trying to use ExcelDataReader to read an .xls file on Ubuntu. I am using VS Code with C#. Here is the code: var stream = File.Open(filePath, mode: FileMode.Open, access: FileAccess.Read); var reader = ExcelReaderFactory.CreateReader(stream); I…
Dalton Cézane
  • 3,672
  • 2
  • 35
  • 60
47
votes
7 answers

Using ExcelDataReader to read Excel data starting from a particular cell

I am using ExcelDataReader to read data from my Excel workbook in C#. But structure of my Excel sheet is such that data to be read can start from any particular cell and not necessarily A1. Can any one Please suggest a way on how this can be…
ChhavishJ
  • 481
  • 1
  • 5
  • 4
22
votes
2 answers

ExcelDataReader.AsDataSet not working

I'm using ExcelDataReader v.2.1. library to read both xls and xlsx files in my C# project. This way: FileStream stream = File.Open(filePath, FileMode.Open, FileAccess.Read); IExcelDataReader excelReader; string extension =…
Mry
  • 239
  • 1
  • 2
  • 4
17
votes
4 answers

Could not load file or assembly ICSharpCode.SharpZipLib... When using nuGet package ExcelDataReader

Error: Could not load file or assembly 'ICSharpCode.SharpZipLib, Version=0.85.5.452, Culture=neutral, PublicKeyToken=1b03e6acf1164f73' or one of its dependencies. The system cannot find the file specified.` Stack: [FileNotFoundException: Could…
Travis J
  • 81,153
  • 41
  • 202
  • 273
12
votes
2 answers

C# error With ExcelDataReader

Recently I was trying to build an app that can read excel files. But just after I select the excel file I get an error saying this: 'ExcelDataReader.Exceptions.HeaderException' occurred in ExcelDataReader.dll Additional information: Invalid file…
Jeremy22
  • 133
  • 1
  • 1
  • 5
8
votes
2 answers

Access Protected Excel File with ExcelDataReader and Epplus

title pretty much says it all. Looking for a way to access a password protected excel file with ExcelDataReader and Epplus, can't find a proper answer. If using ExcelDataReader, my code looks like excelStream =…
Mike H
  • 387
  • 9
  • 25
7
votes
3 answers

How to remove empty cells and rows from file using ExcelDataReader?

I'm using ExcelDataReader to read excel file but the file which being processed has 16k columns and 1200 records each. In between only 52 columns are filled other are empty so I want to remove empty columns with rows. tried with : var dataset =…
Umesh Shende
  • 113
  • 2
  • 11
7
votes
4 answers

ExcelDataReader Datatype "date" gets transformed

the following code reads the data out of an excel file: string path = "testtable.xls"; FileStream stream = File.Open(path, FileMode.Open, FileAccess.Read); IExcelDataReader excelReader =…
reveN
  • 552
  • 2
  • 8
  • 20
7
votes
2 answers

get excel sheet column names using exceldatareader

I'm writing the C# library to read the Excel Files without any other dependencies like OLDEB(AccessDatabaseEngine) library. So I have chosen the ExcelDataReader Library for Reading the .XLS and .XLSX files. ExcelDataReader is perfectly working with…
venkat
  • 513
  • 2
  • 10
  • 16
5
votes
2 answers

How to get sheet name from Excel

How do I get sheet name from Excel and add them to my comboBox list? I can't seem to add it in my code as it is in public static public static DataTable ExcelToDataTable (string fileName) { using (var stream = File.Open(fileName, FileMode.Open,…
user9178291
5
votes
3 answers

Reading Excel xlsb files in C#

There is a new requirement for my project to read various types of Excel files. I am able to read .xls and .xlsx files using the ExcelDataReader dll from Codeplex. The problem is when I try to read .xlsb files. ExcelDataReader cannot read from…
Kaushik Das
  • 99
  • 1
  • 1
  • 8
5
votes
2 answers

Excel Data Reader Issues, column Names, and Sheet Selection

I am using Excel Data Reader to read some data in to an Entity Framework Database The code below is working but i need some further refinements First of all IsFirstRowAsColumnNames does not seem to be working as intended and I have to use .Read…
Frazer
  • 560
  • 2
  • 11
  • 21
4
votes
1 answer

C# ExcelDataReader read from specific columns only

i'm trying to get data from my excel sheet to add it into database which works perfectly but i only want the data under specific headers. Here is my config code: var headers = new List; DataSet result = excelDataReader.AsDataSet(new…
Mohammed Ehab
  • 207
  • 1
  • 5
  • 14
4
votes
3 answers

Always Get Data as String from Excel file using ExcelDataReader

There is a cell in my Excel file containing this number: 5892101102012990 and other cells containing mixed data (also strings) I get this cell's data like this : var filestream = File.Open(@"D:\111XLS\File.xlsx", FileMode.Open, FileAccess.Read,…
Mohsen K
  • 257
  • 4
  • 10
3
votes
2 answers

How to convert IExcelDataReader Values to string Datatype

I am using below code to read Excel and store in Dataset. public DataSet ReadExcelDataToDataSet(Stream fileStream) { DataTable dataInExcelSheet = new DataTable(); IExcelDataReader excelReader =…
chandra sekhar
  • 1,093
  • 4
  • 14
  • 27
1
2 3
9 10