简体   繁体   中英

issues while exporting data from excel by using linqtoexcel in c#

I am following this article http://www.codeproject.com/Articles/659643/Csharp-Query-Excel-and-CSV-Files-Using-LinqToExcel . But the problem now i am facing is ,my excel column name contains .,space etc characters. As per the mapping excel column name and property name should be same. If that is the case how can i insert special characters like . and space in property name. One more question is , is there any license issue regarding those dll's ,if i deploy it in somehwere?

UPDATE

Example of column name is LOCATIONS.CONFIG 3G 2100

Use the ExcelColumn atrribute with your properties.

such as:

[ExcelColumn("Col.umn,Nam,e")] 
public string SomeProperty { get; set; }

Another way is using the AddMapping method:

ExcelQueryFactory qf = ...;
qf.TrimSpaces = TrimSpacesType.Both;
qf.AddMapping<SomeType>(o=>o.SomeProperty,"Col.umn,Nam,e")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM