Skip to content

Added foxpro dbf/fpt writing support, only tested with foxpro version, maybe not backwards compatible.

License

Notifications You must be signed in to change notification settings

c1sc0/dotnetdbf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotnetdbf

This is a basic file parser written in C# for reading and writing xBase DBF files. Pure .NET direct access to xBase DBF. No need OBBC/JDBC for readind and writeing xBase DBF. xBase DBF files are used by Clipper and FoxPro.

Compilable on Linux (Mono). For .net 4.0 projects there is an enumeration framework in which makes it easy to use Linq to Objects.

Code derived from javadbf.

Get The Binaries

Use NuGet from Visual Studio

Quick start

Writng ODF

using (Stream fos = File.Open(dbffile, FileMode.OpenOrCreate, FileAccess.ReadWrite))
      using (var writer = new DBFWriter())
      {        
          writer.CharEncoding = Encoding.GetEncoding(866);
          writer.Signature = DBFSigniture.DBase3;
          writer.LanguageDriver = 0x26; // Eq to CP866
          var field1 = new DBFField("DOCDATE", NativeDbType.Date);
          var field2 = new DBFField("DOCNUMBER", NativeDbType.Char, 50);                    
          ...
          var field9 = new DBFField("f9", NativeDbType.Char, 20);
          writer.Fields = new[] { field1, field2, field3, field4, field5, field6, field7, field8, field9 };
          foreach (var item in items)
          {
              writer.AddRecord(
              ...
              );
          }
          writer.Write(fos);
      }

About

Added foxpro dbf/fpt writing support, only tested with foxpro version, maybe not backwards compatible.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 68.9%
  • Java 31.1%