Closed GoogleCodeExporter closed 8 years ago
I don't like the idea of throwing an exception if not all the class properties
map to
a column in the excel spreadsheet. However, I will begin work on an enhancement
that
will return the list of column names in an excel spreadsheet. Then you will be
able
to query the list of column names and see if any have changed.
Original comment by paulyo...@gmail.com
on 13 Mar 2010 at 3:01
Dear Paul,
Nice to see you proposition concerning column name returning. Do you have any
news according finishing date for this features? kind regards robert
Original comment by robertbi...@gmail.com
on 11 Jun 2010 at 2:28
GetWorksheetNames() and GetColumnNames() methods have been added to the
IExcelQueryFactory interface to take care of this issue.
It is included in the latest file release: LinqToExcel_1.3.77
Original comment by paulyo...@gmail.com
on 13 Jun 2010 at 2:34
I went ahead and implemented the StrictMapping property which does throw an
exception if not all columns and class properties map to each other.
See the documentation for more information:
http://code.google.com/p/linqtoexcel/wiki/UsingLinqToExcel#Strict_Mapping
Original comment by paulyo...@gmail.com
on 13 Jun 2010 at 10:07
This is implemented in version 1.4.79
Original comment by paulyo...@gmail.com
on 13 Jun 2010 at 10:07
[deleted comment]
[deleted comment]
Hello,
I try to use StrictMappingException.in example code below I always haven't
exception.
BEGIN OF CODE BLOCK
excel.StrictMapping = true;
excel.AddMapping<ExcelBiling>(x => x.InvoiceNo, "Invoice No");
excel.AddMapping<ExcelBiling>(x => x.PhoneNumber, "Phone Number");
var worksheetNames = excel.GetWorksheetNames();
var res = from t in excel.GetWorksheetNames()
where !t.EndsWith("_")
select t;
foreach (var item in res)
{
try
{
var result = from c in excel.Worksheet<ExcelBiling>(item.ToString())
where c.PhoneNumer == 608008123
select c;
}
catch (LinqToExcel.Domain.StrictMappingException ex)
{
string message = ex.Message;
}
}
END OF CODE BLOCK
As result I see in error Message = "'Invoice No' column is not mapped to a
property"
Where I'm wrong?
Is my understanding of exception using properly?
kind regards robert
Original comment by robertbi...@gmail.com
on 16 Jun 2010 at 9:55
This is fixed in version 1.4.80
Original comment by paulyo...@gmail.com
on 14 Jul 2010 at 11:52
Original issue reported on code.google.com by
jd.r...@gmail.com
on 9 Mar 2010 at 5:42