0
Using Visual Studio 2017, I installed the reference packages through Nuget
- Exceldatareader
- Ecxeldatareader.Dataset version 3.4.0
I am following a tutorial on how to open XLS file and is giving error on the following line, I would like to know how to resolve this error.
The line that is giving error is this in the code below:
Isfirstrowascolunmnames = true;
It says that it does not contain this definition in Iexceldatareader
I’m using the following using below
- using Exceldatareader;
- using System;
- using System.Data;
- using System.IO;
using System.Windows.Forms;
private void btnOpen_Click(object sender, EventArgs e) { DataSet result; using (OpenFileDialog ofd = new OpenFileDialog() {Filter="Excel Workbook *.xls", ValidateNames = true }) { if(ofd.ShowDialog() == DialogResult.OK) { FileStream fs = File.Open(ofd.FileName, FileMode.Open, FileAccess.Read); IExcelDataReader reader = ExcelReaderFactory.CreateBinaryReader(fs); reader.IsFirstRowAsColunmNames = true; result = reader.AsDataSet(); cbbPlanilha.Items.Clear(); foreach (DataTable dt in result.Tables) { cbbPlanilha.Items.Add(dt.TableName); } reader.Close(); } } }
There is no such method, so of the problem, maybe it is something related to the version, or not even in the tutorial which is the version of
ExcelDataReader
???– novic
Exceldatareader version is 3.4.0
– Cyberlacs
You don’t have that method! It doesn’t exist
– novic