public void FillPersistentData() { for (int i = 0; i < rowCount; i++) { object[] rowData = GetRowData(i); DataRow2 row = persistentTable.NewRow(); for (int j = 0; j < persistentColInds.Count; j++) { row[j] = rowData[persistentColInds[j]]; } persistentTable.AddRow(row); } }
private int GetIntValue(DataRow2 row, int colInd) { bool isInt = columnTypes[colInd] == ColumnType.Integer; object o = row[colInd]; if (isInt) { if (o == null || o is DBNull || o.ToString().Length == 0) { return(0); } return((int)o); } return(0); }
private double GetDoubleValue(DataRow2 row, int colInd) { bool isInt = columnTypes[colInd] == ColumnType.Integer; bool isDouble = IsNumeric(colInd); object o = row[colInd]; if (isInt || isDouble) { if (o == null || o is DBNull || o.ToString().Length == 0) { return(double.NaN); } if (isInt) { return((int)o); } return((double)o); } return(double.NaN); }
public void RemoveRow(DataRow2 row) { Rows.Remove(row); }
public void InsertRow(int index, DataRow2 row) { Rows.Insert(index, row); }
public void AddRow(DataRow2 row) { Rows.Add(row); }
private int GetIntValue(DataRow2 row, int colInd) { bool isInt = columnTypes[colInd] == ColumnType.Integer; object o = row[colInd]; if (isInt){ if (o == null || o is DBNull || o.ToString().Length == 0){ return 0; } return (int) o; } return 0; }
private double GetDoubleValue(DataRow2 row, int colInd) { bool isInt = columnTypes[colInd] == ColumnType.Integer; bool isDouble = IsNumeric(colInd); object o = row[colInd]; if (isInt || isDouble){ if (o == null || o is DBNull || o.ToString().Length == 0){ return double.NaN; } if (isInt){ return (int) o; } return (double) o; } return double.NaN; }