exceldatareader

uploading and reading from an excel file in asp.net core 2

六眼飞鱼酱① 提交于 2019-12-24 21:23:18
问题 previously Asp.Net MVC had this third party library which easily allowed uploading and reading from an excel file called Excel Data Reader. We didn't need to have the file on the local disk, which was great because my application needs to run on Azure. However we are now porting this functionality to asp.net core 2, and it seems from searching that this is not possible. Does anybody know any libraries that would allow me to do this? Please note, I am not looking for solutions that read from a

How to convert IExcelDataReader Values to string Datatype

久未见 提交于 2019-12-24 12:58:12
问题 I am using below code to read Excel and store in Dataset. public DataSet ReadExcelDataToDataSet(Stream fileStream) { DataTable dataInExcelSheet = new DataTable(); IExcelDataReader excelReader = ExcelReaderFactory.CreateReader(fileStream); DataSet excelDataSet = excelReader.AsDataSet(new ExcelDataSetConfiguration() { UseColumnDataType = false //Do we have any property here to convert all rows values to string datatype. }); excelReader.Close(); return excelDataSet; } Is there any way to convert

How to get sheet name from Excel

半城伤御伤魂 提交于 2019-12-23 12:56:12
问题 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, FileAccess.Read)) { using (var reader = ExcelReaderFactory.CreateReader(stream)) { var result = reader.AsDataSet(new ExcelDataSetConfiguration() { UseColumnDataType = true, ConfigureDataTable = (data) => new ExcelDataTableConfiguration() { UseHeaderRow

ExcelDataReader FilterColumn usage

核能气质少年 提交于 2019-12-23 01:42:11
问题 I am trying to return a data set that returns the first row as the header row(this is working) as well as filter out entire columns from the data depending on their column header. ExcelDataReader 3.4.0 introduced the FilterColumn callback option which I am attempting to utilize. Below is my AsDataSet call var ds = reader.AsDataSet(new ExcelDataSetConfiguration() { ConfigureDataTable = (tableReader) => new ExcelDataTableConfiguration() { // Gets or sets a value indicating whether to use a row

How to extract link url from Excel cell

荒凉一梦 提交于 2019-12-11 07:16:48
问题 I have a c# webjob that downloads and then reads an Excel file. One of the columns contains links that I'd like to save in my database. I'm currently using ExcelDataReader to convert the Excel file to a DataSet and then looping through the rows to grab the data. After conversion the column in question at this point is only a string containing the link text. From some other reading it sounds like in Excel, hyperlinks are stored elsewhere and that information isn't preserved when converting the

Excel Data Reader Issues, column Names, and Sheet Selection

家住魔仙堡 提交于 2019-12-07 17:50:28
问题 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 instead. The fudge i had in originally to select a particular sheet was has scuppered plans, can anyone help with this excelReader.Name at the moment is pointless unless i can specifically loop through or select a sheet, which I originally used .Read

Access Protected Excel File with ExcelDataReader and Epplus

安稳与你 提交于 2019-12-07 08:56:54
问题 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 = File.Open(excelFilePath, FileMode.Open, FileAccess.Read); excelReader = ExcelReaderFactory.CreateOpenXmlReader(excelStream); excelDataSet = excelReader.AsDataSet(); If using EPPlus my connection code looks like excelPackage = new ExcelPackage(new FileInfo(excelFilePath)); excelWorkbook

Using ExcelDataReader to read Excel data starting from a particular cell

喜你入骨 提交于 2019-11-28 20:30:46
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 achieved using ExcelDataReader ? shA.t 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

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

。_饼干妹妹 提交于 2019-11-28 09:40:51
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 also tried this: var reader = ExcelDataReader.ExcelReaderFactory.CreateBinaryReader(stream); When I run, I am getting the following exception: Unhandled Exception: System.NotSupportedException: No data is available for encoding 1252. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. at