Questions tagged [linq-to-excel]

Retrieve data from spreadsheets and csv files by using LINQ

Project Home Page: https://github.com/paulyoder/LinqToExcel

145 questions
16
votes
4 answers

Read an Excel spreadsheet in memory

How can I read an Excel spreadsheet that was just posted to my server? I searched for something but I only found how to read an Excel spreadsheet with the file name path which is not my case. I need something like that: public ActionResult…
MuriloKunze
  • 15,195
  • 17
  • 54
  • 82
8
votes
3 answers

Referencing columns in LinqToExcel using ordinal position

I am in the unusual position of having two different templates for an Excel upload, one that is 'human friendly' and one that is machine generated. As such, the column data headers are different and it is difficult to align them. As such, I would…
Bill Sempf
  • 976
  • 2
  • 13
  • 40
7
votes
3 answers

Could not load file or assembly 'LinqToExcel, Version

I am trying to read an xlsx file. I got exception that The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. c# then I installed it from here http://www.microsoft.com/en-us/download/details.aspx?id=13255 then I changed…
Anastasie Laurent
  • 877
  • 2
  • 14
  • 26
7
votes
2 answers

LinqToExcel GetColumnNames at specific Row

I am using the library LinqToExcel to read excel files in my mvc4 project. My problem is when I try to read the headers at row 4... How I can do this? In project, exists a function that returns all the column names, but I suppose that the columns…
Carlos Novo
  • 139
  • 4
  • 11
7
votes
5 answers

LinqToExcel - Need to start at a specific row

I'm using the LinqToExcel library. Working great so far, except that I need to start the query at a specific row. This is because the excel spreadsheet from the client uses some images and "header" information at the top of the excel file before…
contactmatt
  • 18,116
  • 40
  • 128
  • 186
5
votes
1 answer

C# - LINQToExcel - Null Values

I'm trying to learn how to use LINQTOExcel to query a CSV file. Following the tutorial on the site I adapted their example to work with my data (filename is passed to it via an OpenDialog component): var csv = new ExcelQueryFactory(filename); var…
backdesk
  • 1,781
  • 3
  • 22
  • 42
5
votes
3 answers

Visual Studio 2015 LinqToExcel doesn't work

I have an asp.net app written in VS2012. I was using LinqToExcel without any problems until I moved to VS2015. Here is my code: var excel = new ExcelQueryFactory(fileName); var entriesQuery = from entry in excel.Worksheet(0) …
petros
  • 705
  • 1
  • 8
  • 26
5
votes
1 answer

LinqToExcel dot in header

Using linqtoexcel to read a server generated spreadsheet. Only problem is that there is a dot in one of the headers and it refuses to pull. Manufacturer is abbreviated to Mfg. I used the following code per the example on their page …
Dave_750
  • 1,225
  • 1
  • 13
  • 28
5
votes
1 answer

Reading xlsx saved as xls with LinqToExcel

Look at this post: Excel "External table is not in the expected format." I have the same problem depicted in that post but I'm using LinqtoExcel to read the file instead of plain queries. What would be the LinqToExcel equivalent for setting the…
daniloquio
  • 3,822
  • 2
  • 36
  • 56
4
votes
2 answers

How do I use LinqToExcel to get the sheet names of an Excel file?

I am using LinqToExcel. I want to be able to get the names of all sheets in an Excel file and compare them with an input value from my html form such that when the input value does not match any of the names on the Excel sheet, the system throws an…
plasteezy
  • 257
  • 6
  • 14
4
votes
1 answer

LinqToExcel - InvalidCastException leading to Object must implement Iconvertible error

I'm using the following code to query an excel file in LinqToExcel: var excelFile = new LinqToExcel.ExcelQueryFactory(@"\"+txtFileName.Text.Replace(@"\\",@"\")); var properties = from p in excelFile.Worksheet() where…
Rolan
  • 2,924
  • 7
  • 34
  • 46
4
votes
2 answers

Get all the values from excel file by using linqtoexcel

I'm using linqtoexcel in my asp.net mvc 4 project to read an excel file & get all the values from there. But I'm only getting the values of last row. Here are my codes, Controller public ActionResult ExcelRead() { string…
Shihan Khan
  • 2,180
  • 4
  • 34
  • 67
4
votes
1 answer

Issues in mapping Class Properties to Excel/Spreadsheet Column Names (when using LinqToExcel Library)

Following is my Person Class public class Person { public string Name { get; set; } public int Age { get; set; } public string Gender { get; set; } } Following is my Code that tries to Read from ExcelSpreadSheet using LinqToExcel…
Sike12
  • 1,232
  • 6
  • 28
  • 53
3
votes
1 answer

LinqToExcel exception handling on "wrong" cells

I've got an ASP.NET project where I want to adopt LinqToExcel lib. For test purpose I created small class: public class Point { [ExcelColumn("Stop ID")] public int PointID{get;set;} [ExcelColumn("Name")] public string Name{get;set;} …
andreyfromnn
  • 91
  • 1
  • 4
3
votes
2 answers

How to get columns from the excel generated using EPPLUS

I have an excel generated using EPPlus, I want to get all the column names in a sheet. I have tried using LinqToExcel var excelFile = new ExcelQueryFactory(excelPath) IQueryable excelSheetValues = from workingSheet in…
D Rao
  • 41
  • 2
  • 8
1
2 3
9 10