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
1
vote
1 answer

Can't random orderby while using LinqToExcel

I am using the LinqToExcel project developed by MIT and hosted on Google Code at http://code.google.com/p/linqtoexcel/wiki/UsingLinqToExcel to parse my dataset from an excel table which looks something like this: Part of the dataset I'm trying to…
Frets
  • 141
  • 2
  • 11
1
vote
1 answer

C# LinqToExcel, Distinct showing all results - tried online solutions, couldn't solve

var ItemMaster = new ExcelQueryFactory("E:\\Group Item Master.xlsx"); var ItemList = (from x in ItemMaster.Worksheet() select new { CategoryName =…
Arun Prasad E S
  • 9,489
  • 8
  • 74
  • 87
1
vote
2 answers

ToDictionary error with LINQ

I am having trouble converting these expressions into lambdas without error (Cannot convert type error): var excel = new ExcelQueryFactory(@"E:\MAHipotCepaStationProgram.xlsx"); //get list of program names List testNames = new…
1
vote
2 answers

LinqToExcel to load Dictionary

I have the following worked out but quite less than elegant. I'd like to work this out with ToDictionary if possible. Thank you for any help as I'm pretty new. var excel = new ExcelQueryFactory(@"E:\MAHipotCepaStationProgram.xlsx"); //get list…
1
vote
1 answer

LinqToExcel - Reading a decimal from an *.xlsx file

I've been fiddling around with this for a couple of hours now and i'm kind of walking in circles. I'm missing something. I'm trying to read an excel sheet with Linq to Excel. Everything works in order, except for decimals in the sheet. I've tried a…
Obelix
  • 708
  • 11
  • 24
1
vote
1 answer

Having problems reading an Excel spreadsheet using LinqToExcel, when dates are involved

I've got an Excel spreadsheet from our HR department that needs to be loaded into a database. One column has dates in it. I've searched here on SO and found 2 answers (first one and the second one) which I thought might address my problem, but…
Rod
  • 4,107
  • 12
  • 57
  • 81
1
vote
1 answer

Initialize an object before an if statement

in my program I am reading in an excel sheet and am doing some linq selections, which worked fine. Problem: I tried to make a preselection by applying an If-statement. The variable will be assigned in every case (if/else) but the compiler doesn't…
Julian Bechtold
  • 167
  • 1
  • 12
1
vote
1 answer

Linq / Linqtoexcel issue selecting

I have a weird issue which I totally not understand. Maybe I'm missing something. var excel = new ExcelQueryFactory("products.xlsx"); //get all products with discount var discounts = from s in excel.Worksheet() where …
Julian Bechtold
  • 167
  • 1
  • 12
1
vote
1 answer

LinqToExcel get hyperlink value

I'm using LinqToExcel to read an excel file. Everything works fine, but it the content of a cell is a hyperlink, I only get the hyperlink text. I would like to get its URL/email. try { // Connection to the DB iRentDB db = new iRentDB(); …
user6824563
  • 735
  • 6
  • 25
  • 47
1
vote
1 answer

LinqToExcel C# Automatically casting CSV values to DATETIME

I am currently using LinqToExcel to parse through a valid CSV file, but when I reach a particular column (which is not a date), it gets automatically casted into a datetime variable. Example: 2/010/114 will get casted to cc = "2/10/0114 12:00:00…
Dan
  • 231
  • 1
  • 12
1
vote
1 answer

Question considering LINQ to Excel

I'm reading data from an XLS document, and I'm using the superb LINQ to Excel library. The problem I have is more of a problem with dealing with LINQ. I read new and updated incidents from an excel sheet. So I want check if the incident already…
Fore
  • 5,726
  • 7
  • 22
  • 35
1
vote
3 answers

read Excel sheet with linq- skip duplicated id

In following excel file, I need to read rows as Student class which define single object for the unique ID and then get all exams associated with this student. If I used the following code I generate number of students equal to number of rows and…
user1217585
1
vote
1 answer

Can I use LinqToExcel for saving edited data to excel?

I am using LinqToExcel for sorting of data. I want to save sorted data back to excel. For that is there any function in LinqToExcel
Prasad Joshi
  • 471
  • 4
  • 12
1
vote
1 answer

Linq to Excel Not Retrieving First Populated Row

I'm just starting out in Linq to Excel today, so I assume I've missed something rather simple. I want to print the entire contents of an Excel Worksheet, But the ExcelQueryable object is not returning the first populated row. The syntax I've used…
Jace
  • 777
  • 1
  • 5
  • 18
1
vote
1 answer

LinqToExcel C# - How to NOT read empty row

I want to read data from an excel table that looks like this: Worksheet name is "Data". I store the data into List. Then I do a List.Count, and it is more than 11 even though I only have 11 non-empty rows. public class ExcelData …
Liren Yeo
  • 3,215
  • 2
  • 20
  • 41