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

LinqtoExcel: Not able to use where clause to select a row data

I am using linqtoexcel for my automation project. This file contains different site URL and its credentails. If I use only one row I am able to login to that site. But if there are two rows then I am having problem in using where clause. Please help…
user5687551
1
vote
1 answer

LinqToExcel Duplicate Column Names

I have a machine generated excel file that has a few columns with the same name. e.g.: A B C D Group 1           Group 2 Period | Name     Period | Name And i got a DTO like this: [ExcelColumn("Period")] public string…
Mateus Cerqueira
  • 457
  • 4
  • 13
1
vote
1 answer

How to import data to GridView Using Linq To Excel

I want to import data to gridview from Excel. And I have done using System.Data.OleDb as if (ExlSheet.HasFile) { string fileName = Path.GetFileName(ExlSheet.PostedFile.FileName); string fileExtension =…
ha chitti
  • 139
  • 2
  • 11
1
vote
0 answers

Obtain a column data when a condition meets using LinqToExcel

I'm using LinqToExcel to get some data from an excel file and it works just fine for the common tasks, but there is a problem when a column extends to many rows. This is the common task, get a data row. But when a column from the same record…
1
vote
1 answer

LinqToExcel and currency format (Culture)

I use LinqToExcel in my application for a while now and has been working like a charm. But I'm facing a problem reading currency strings from Excel. I can't post images yet, but the value in excel is 9999 formated like 9.999,00 (pt-BR) Local in my…
1
vote
1 answer

Linq to Excel - Object must implement IConvertible error

The following code is showing this error Object must implement IConvertible when I am adding the where clause in the LINQ expression to compare the DateTime field. I tried to use Convert.ToDateTime(c.ETC) >= startday but still the same error. var…
1
vote
1 answer

EPPlus and Linq To Excel Query all the rows

With EPPlus and Linq To Excel does anyone know the syntax on how to get all the rows? IQueryable excelSheetValues = from workingSheet in excelFile.Worksheet(sheetName) select workingSheet; This is not retrieving ant data. How to get all the…
SamKPrasad
  • 23
  • 2
  • 10
1
vote
1 answer

Create a list of objects that directly represents an Excel sheet

Using LinqToExcel, I'm trying to create a dynamic list of objects that have a dynamic number of properties (with values). Essentially, the list of objects should directly represent the contents of an Excel sheet. However, I don't know the header…
navig8tr
  • 1,724
  • 8
  • 31
  • 69
1
vote
1 answer

Predicate not being applied in LinqToExcel query

I have come across the LinqToExcel library and have been playing around with it a bit. I seem to be mis-understanding how the querying works. I have created a simple worksheet with some customer info. Using LinqPad, I've setup my query as so: void…
Sleette
  • 366
  • 3
  • 13
1
vote
0 answers

Importing data with LinqToExcel - Readonly properties

I'm trying to import data from excel using LinqToExcel. I have few readonly properties in the model class. When I try to map them with the excel columns, they fail with following error. Also when I drop those columns from excel, it works fine…
ecasper
  • 489
  • 1
  • 10
  • 30
1
vote
1 answer

Setup for testing a Linq query on a LinqToExcel IExcelQueryFactory

Using c#, Moq, MSTest, LinqToExcel I'm having trouble figuring out the best way to Setup() a mock for a response from a Linq query on a Linq-to-Excel IExcelQueryFactory. I think I should expect the Linq Query to return something of type delegate,…
MLH
  • 743
  • 1
  • 5
  • 13
1
vote
3 answers

Change column names or properties of an Excel worksheet via Linq

I'm wondering how to raise the column names or properties of a worksheet into UPPERCASE without knowing how many there are or what their contents is? My current code is as follows: var excel = new ExcelQueryFactory(fileLocation); var dataSheet =…
Hugo
  • 11
  • 1
  • 3
1
vote
1 answer

Converting LinqToExcel.RowNoHeader type into string

I have been using LinqToExcel Library Lately and i came across this issue. here is the code var excel = new ExcelQueryFactory(fileName); var dataList = (from c in excel.WorksheetRangeNoHeader("A1", "A4", "Test Worksheet") select…
Sike12
  • 1,232
  • 6
  • 28
  • 53
1
vote
2 answers

Linq to Excel - only recieving data from last row in sheet1

After the headache of attempting to query an Excel spreadsheet with ADO.NET, I've decided to try Linq to Excel in my project. I have created a method that is supposed to return the value of column B when I provided it with the corresponding value of…
Cody Hicks
  • 420
  • 9
  • 24
1
vote
4 answers

Mapping/Transformation to handle Enum model with LinqToExcel

I'm having an issue handling one column of the Excel file I'm trying to import to my database. The property refers to an Enum model. I tried putting integers values (referring to the Enum index) or the string value themselves but obviously it…
Orphu.of.io
  • 125
  • 1
  • 16