/// <summary> /// Reads the next row of data columns corresponding to the format in the datarow /// </summary> /// <returns></returns> public void ReadNext(DataRow dr) { for (int j = 0; j < dr.Table.Columns.Count; j++) { DBFEntry E; if (_columns.TryGetValue(dr.Table.Columns[j].ColumnName, out E)) { //Find the corresponding .NET Type switch (E._dbfType) { case ShapeLib.DBFFieldType.FTDate: dr[j] = ShapeLib.DBFReadDateTimeAttribute(_dbfPointer, _recordPointer, E._index); break; case ShapeLib.DBFFieldType.FTDouble: dr[j] = ShapeLib.DBFReadDoubleAttribute(_dbfPointer, _recordPointer, E._index); break; case ShapeLib.DBFFieldType.FTInteger: dr[j] = ShapeLib.DBFReadIntegerAttribute(_dbfPointer, _recordPointer, E._index); break; case ShapeLib.DBFFieldType.FTLogical: dr[j] = ShapeLib.DBFReadLogicalAttribute(_dbfPointer, _recordPointer, E._index); break; case ShapeLib.DBFFieldType.FTString: dr[j] = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(ShapeLib.DBFReadStringAttribute(_dbfPointer, _recordPointer, E._index)); break; case ShapeLib.DBFFieldType.FTInvalid: default: break; } } } _recordPointer++; }
public int ReadInt(int record, string ColumnName) { return(ShapeLib.DBFReadIntegerAttribute(_dbfPointer, record, _columns[ColumnName]._index)); }