Home
CMS
Muziek
Nieuws
Over Matthijs
Portfolio
Shop
Video Productie
Wordpress
Contact
dBase NuPackage Read DB File and return a DataTable (02-mrt-2020)
Use this NuPackage:
https://github.com/henck/dBASE.NET
This function will read the DBase-file and returns a DataTable:
public DataTable Read_dBase_File(string fullFilename)
{
// Read file
var dbf = new Dbf();
dbf.Read(fullFilename);
// DataTable
var dt = new DataTable();
// Cols
for (int i = 0; i < dbf.Fields.Count; i++)
{
dt.Columns.Add(dbf.Fields[i].Name, dbf.Fields[i].GetType().GetProperties()[0].PropertyType);
}
// Rows
foreach (DbfRecord record in dbf.Records)
{
var row = dt.NewRow();
for (int i = 0; i < dt.Columns.Count; i++) row[i] = record.Data[i];
dt.Rows.Add(row);
}
// Clean
dbf = null;
// Return
return dt;
}
29-01-20
NFCWSoftware - MiFare Classic - ACR122U NFC Reader
10-10-19
Whatsapp bericht sturen naar 06-nummer zonder contact
27-09-19
Youtube Embed Video 100% in iframe
11-03-19
Parrot CK 3100 Carkit - Firmware Update Tool
Bekijk meer nieuws >>