Click here to Skip to main content
15,892,809 members
Articles / Programming Languages / C#

Building an embedded database engine in C#

Rate me:
Please Sign up or sign in to vote.
4.91/5 (110 votes)
10 Jun 2009CPOL8 min read 322.7K   10K   347  
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
{
#pragma warning disable 649

    [Record(FieldMapping = FieldMapping.ExplicitColumnsOnly, Width = 32)]
    internal class NdxHeader 
    {
        [Column(Type = ColumnType.UINT32)]
        private UInt32 mNativeNdxStartingPageRecordNo; //0..3

        public UInt32 StartingPageRecordNo
        {
            get { return mNativeNdxStartingPageRecordNo - 1; }
            set { mNativeNdxStartingPageRecordNo = value + 1; }
        }


        [Column(Type = ColumnType.UINT32)]
        public UInt32 TotalNoOfPages; //4..7

        [Column(Type = ColumnType.UINT32)]
        public UInt32 Zero; //8..11

        [Column(Type = ColumnType.UINT16)]
        public UInt16 KeyLength; //12..13


        [Column(Type = ColumnType.UINT16)]
        public UInt16 NoOfKeysPerPage; // 14..15

        [Column(Type = ColumnType.UINT16)]
        public UInt16 KeyType; // 16..17 - 0 = char; 1 = num

        [Column(Type = ColumnType.UINT32)]
        public UInt32 SizeOfKeyRecord; // 18..21

        [Column(Type = ColumnType.BYTE)]
        public Byte Reserved; // 22

        [Column(Type = ColumnType.BOOL)]
        public bool UniqueFlag; // 23

        [Column(Type = ColumnType.CHARACTER, Width = 255)] // 
        public string KeyString1; // 24..

        [Column(Type = ColumnType.CHARACTER, Width = 233)] // 512 - 255 - 24
        public string KeyString2;
    }

}

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)


Written By
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.

Comments and Discussions