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

ExcelQueryFactory to read a password protected excel

How can I read password protected Excel workbook using ExcelQueryFactory? I am able to read the excel when it is not password protected using the code below. var excel = new ExcelQueryFactory(); excel.FileName = "path of excel file"; But when the…
CoolDiva
  • 209
  • 1
  • 3
  • 14
1
vote
1 answer

Linq to Excel fails to parse mixed string and numeric content

I noticed something interesting when trying to use the library LinqToExcel. var factory = new ExcelQueryFactory(@"TestData\myFile.xlsx"); var model = categoryHandler.GetCategoryTree(factory.Worksheet("WorkSheetName").ToList()); I use the…
TGH
  • 38,769
  • 12
  • 102
  • 135
1
vote
3 answers

Why does ExcelQueryFactory only return 255 columns

I have a spreadsheet that has about 500 columns. When I execute the linq query below, it only returns 255 columns. Is that a limitation on ExcelQueryFactory? Could it be an issue with my spreadsheet? var book = new…
BriceTRockindale
  • 309
  • 1
  • 4
  • 15
1
vote
1 answer

Can I specify the data type for a column rather than letting linq-to-excel decide?

I have noticed the following when working with linq-to-excel: I'm trying to import rooms from a spreadsheet. I have a simple class public class Room { public int BuildingID { get; set; } public string RoomNumber { get; set; } …
Nils
  • 1,237
  • 3
  • 11
  • 28
1
vote
1 answer

Pull entire excel row using LinqToExcel

I am trying to pull an entire row of values off of an excel file using linq to excel. I have all of the column names (there's 104 different ones) and now I just need to get the one row of values associated with each header. What I would like to do…
Rob Jarvis
  • 356
  • 1
  • 4
  • 13
1
vote
0 answers

How to dynamically determine the endrange when using LinqToExcel

I use LinqToExcel in my applications but cannot figure the best way to dynamically set the end range when reading data. We currently use an arbitrarily large value e.g. 30000 but this only ok when I'm sure the range won't exceed a certain…
majjam
  • 1,286
  • 2
  • 15
  • 32
1
vote
1 answer

How can I get cell formatting when querying via LinqToExcel

I am using LinqPad in conjunction with Linq2Excel to do my own data analysis on an Excel spreadsheet (written and owned by others). These other people use a lot of cell formatting to represent data. For example, a grey background cell means "not…
philologon
  • 2,093
  • 4
  • 19
  • 35
1
vote
0 answers

LinqToExcel only works when file is open

I am using C# LinqToExcel to upload data from a spreadsheet to the database. I have noticed when the file is open it is able to retrieve the data from the spreadsheet. However if it is not open on my machine I get this error: base…
nick gowdy
  • 6,191
  • 25
  • 88
  • 157
1
vote
1 answer

Importing data with LinqToExcel

I have an XLSX spreadsheet that I am trying to import into a IList(of FinancialResults) collection using VB.NET. The spreadsheet is in the below format where I need to map the cells from the appropriate columns into a…
Phil Murray
  • 6,396
  • 9
  • 45
  • 95
1
vote
2 answers

Filtering of blank rows in LinqToExcel before parsing (transformation / mapping)

I am using LinqToExcel to map Excel rows to objects in a C# / .NET project. I put validation code in my transformation functions so that they do not only transform the data but also warn the user when there is some data…
hansmbakker
  • 1,108
  • 14
  • 29
1
vote
1 answer

create a DataSet using LinqToExcel:

I am using LinqToExcel in my web application for getting WorksheetNames and columnnames, now i want to show some datas in gridview.Is there any method to create a DataSet using LinqToExcel.
bensonissac
  • 635
  • 5
  • 10
1
vote
1 answer

LinqToExcel ignore certain columns from StrictMapping

I am reading Excel file using LinqToExcel: var Excel = new ExcelQueryFactory(Filename); Excel.databaseEngine = DatabaseEngine.Ace; Excel.strictMapping = true; I want to exclude certain columns, to prevent the strict mapping feature from throwing…
Gaurav Moolani
  • 342
  • 1
  • 3
  • 12
1
vote
1 answer

LinqToExcel sometimes results in IErrorInfo.GetDescription failed with E_FAIL(0x80004005)

Sometimes when running the code below it results in the error IErrorInfo.GetDescription failed with E_FAIL(0x80004005) from the call to excelFile.WorksheetNoHeader(0). It doesn't seem to depend on the excel file, one file can be readable one time…
Carl Björknäs
  • 593
  • 4
  • 15
0
votes
1 answer

LinqToExcel System.ArgumentException in c#

I am using LinqToExcel in my .net framework project to read some excel files. Sometimes I receive a file with a date error, and when I try to convert my ExcelQueryable to a list of rows using excel.Worksheet(worksheetName).ToList(); or foreach (var…
Ângelo
  • 1
  • 3
0
votes
2 answers

How do i use LinqToExcel to get cell values contained in the excel file

I am using this code to retrieve the receipient name and receipient number but the recpt.receipient_name and recpt.receipient_number are null. The excel table is of this format Name Number andrew 1223 james 12223 dave …
plasteezy
  • 257
  • 6
  • 14