Click here to Skip to main content
12,359,102 members (33,090 online)
Click here to Skip to main content

Stats

180.6K views
7.8K downloads
338 bookmarked
Posted

Building an embedded database engine in C#

, 10 Jun 2009 CPOL
DbfDotNet is a very fast and compact fully managed standalone database/entity framework, for the .Net Framework.
using System;
using System.Collections.Generic;
using System.Text;

namespace DbfDotNet.Core
{
    [Record(FieldMapping = FieldMapping.ExplicitColumnsOnly, Width = 32)]
    internal class DbfHeader
    {
        [Column(Type = ColumnType.BYTE)]
        public byte VerNumber;

        [Column(Type = ColumnType.DATE_YMD)]
        public DateTime LastUpdate;

        [Column(Type = ColumnType.UINT32)]
        public UInt32 NbRecords;

        [Column(Type = ColumnType.UINT16)]
        public UInt16 HeaderWidth;

        [Column(Type = ColumnType.UINT16)]
        public UInt16 RecordWidth;

        [Column(Type = ColumnType.INT16)]
        public Int16 Zero;

        [Column(Type = ColumnType.BYTE)]
        public byte IncompleteTransaction;

        [Column(Type = ColumnType.BYTE)]
        public byte EncryptionFlag;

        [Column(Type = ColumnType.DELAYED, Width = 12)]
        public byte[] LanOnly;

        [Column(Type = ColumnType.BYTE)]
        public byte Indexed;
        // MdxFlag

        [Column(Type = ColumnType.BYTE)]
        public byte Language;

        [Column(Type = ColumnType.INT16)]
        public Int16 Zero2;

        public void Clear()
        {
            VerNumber = 0;
            LastUpdate = DateTime.MinValue;
            NbRecords = 0;
            HeaderWidth = 0;
            RecordWidth = 0;
            Zero = 0;
            IncompleteTransaction = 0;
            EncryptionFlag = 0;
            LanOnly = new byte[] { };
            Indexed = 0;
            Language = 0;
            Zero2 = 0;
        }
    }

}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Pascal Ganaye
Software Developer (Senior)
France France
I am a French programmer.
These days I spend most of my time with the .NET framework, JavaScript and html.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160621.1 | Last Updated 10 Jun 2009
Article Copyright 2009 by Pascal Ganaye
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid