public string GetCellValueString(int index, string defaultValue) { ExcelCell cell = this.GetCell(index); if (cell == null || cell.Type == ExcelCellTypes.Null) { return(defaultValue); } return(cell.Value.ToString()); }
public double GetCellValueNumberic(int index, double defaultValue) { ExcelCell cell = this.GetCell(index); if (cell == null || cell.Type == ExcelCellTypes.Null) { return(defaultValue); } double value; if (!double.TryParse(cell.Value.ToString(), out value)) { return(defaultValue); } else { return(value); } }