[英]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 . 我正在关注本文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. 但是我现在面临的问题是,我的Excel列名称包含。,空格等字符。 As per the mapping excel column name and property name should be same. 根据映射excel列名称和属性名称应相同。 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? 另一个问题是,如果我将dll部署到这些dll中,是否存在任何许可证问题?
UPDATE UPDATE
Example of column name is LOCATIONS.CONFIG 3G 2100
列名称的示例是LOCATIONS.CONFIG 3G 2100
Use the ExcelColumn
atrribute with your properties. 对属性使用ExcelColumn
属性。
such as: 如:
[ExcelColumn("Col.umn,Nam,e")]
public string SomeProperty { get; set; }
Another way is using the AddMapping
method: 另一种方法是使用AddMapping
方法:
ExcelQueryFactory qf = ...;
qf.TrimSpaces = TrimSpacesType.Both;
qf.AddMapping<SomeType>(o=>o.SomeProperty,"Col.umn,Nam,e")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.