0
Excel 시트에서 셀을 가져오고 있습니다. 이것은 제가 얻는 결과입니다.foreach 루프를 사용하여 Excel 시트에서 목록 생성
Cell A2 has value 113,295
Cell B2 has value 540
Cell C2 has value 41,044
Cell A3 has value 192,653
Cell B3 has value 510
Cell C3 has value 41,037
코드 :
using (ExcelPackage package = new ExcelPackage(existingFile))
{
ExcelWorksheet sheet = package.Workbook.Worksheets[1];
//Select all cells in column d between 9990 and 10000
var query1 = (from cell in sheet.Cells["A2:C2"] select cell);
int count = 0;
string[] s = null;
foreach (var cell in query1)
{
Console.WriteLine("Cell {0} has value {1:N0}", cell.Address, cell.Value);
}
내 문제는 내가 회원들과 함께, b와 c를 클래스를 만들려면 내가이 개체의 컬렉션을 보유 할 목록 <>를 원하는 것입니다.
현재 iterating 중이지만 for 루프에서 어느 셀이 A, B 또는 C인지 알 수 없습니다.