I'm importing numerical data from excel file using NPOI. And as for reading cell, i've got this problem "Cannot implicitly convert convert type NPOI.SS.UserModel.ICell to Double".
public class Clas {
public double CellValue;
public string CellName;
}
...
public CLAS ClasMaker(int a, int b)
{
C ClaA;
ClaA.CellValue = sheet.GetRow(a).GetCell(b) // here
ClaA.CellName = sheet.Getrow(a).GetCell(b-1).ToString() // As for string its okay i used ToString()
}
How to convert ICell into specific type like a ToString()?
I can't change type of CellValue into var. because its declared in many other things as double.
Look here for documentation of the ICell. It looks like what you'd want to do is sheet.GetRow(a).GetCell(b).NumericCellValue. You may also want to change toString() to StringCellValue as toString may just return the class name with hash code or something of the sort.