Using ExcelDataReader to read Excel data starting from a particular cell

If you are using ExcelDataReader 3+ you will find that there isn’t any method for AsDataSet() for your reader object, You need to also install another package for ExcelDataReader.DataSet, then you can use the AsDataSet() method. Also there is not a property for IsFirstRowAsColumnNames instead you need to set it inside of ExcelDataSetConfiguration. Example: using … Read more

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

I faced the same problem with .net Core application. I added the System.Text.Encoding.CodePages nuget package and registered the encoding provider before ExcelReaderFactory.CreateReader(stream) which resolved the issue. System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); //open file and returns as Stream using (var stream = File.Open(fileName, FileMode.Open, FileAccess.Read)) { using (var reader = ExcelReaderFactory.CreateReader(stream)) { } }