NDbfReader is a .NET library for reading dBASE (.dbf) files. The library is simple, extensible and without any external dependencies.
using (var table = Table.Open("D:\\foo.dbf"))
{
// default is ASCII encoding
var reader = table.OpenReader(Encoding.GetEncoding(1250));
while(reader.Read())
{
var name = reader.GetString("NAME");
//...
}
}
An entire table can be loaded into a DataTable
:
using (var table = Table.Open("D:\\foo.dbf"))
return table.AsDataTable();
Non-seekable (forward-only) streams are also supported:
[HttpPost]
public ActionResult Upload(HttpPostedFileBase file)
{
using (var table = Table.Open(file.InputStream))
//..
}
Install-Package NDbfReader
Clone the repository and run build.cmd
. At least Visual Studio Community 2015
is required.
Run run-tests.cmd
.
Run test-coverage.cmd
to calculate test coverage with OpenCover.