Click here to Skip to main content
13,549,157 members
Click here to Skip to main content


338 bookmarked
Posted 1 Jun 2009
Licenced CPOL

Building an embedded database engine in C#

, 10 Jun 2009
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)]
    internal class NdxEntry 
        [Column(Type = ColumnType.UINT32)]
        internal UInt32 mNdxNativeLowerPageNo;

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

        private SortFields mFields;
        public SortFields Fields
            get { return mFields; }
            set { 
                if (mFields==value) return;
                mFields = value;

        public UInt32 LowerPageRecordNo
            get { return mNdxNativeLowerPageNo - 1; }
            set { mNdxNativeLowerPageNo = value + 1; }

        public int ChainCompare(int[] cmp, NdxFile index, NdxEntry other)
            this.Fields.ChainCompare(other.Fields, cmp);
            // to do check for ascending descending
            for (int i = 0; i < cmp.Length; i++)
                if (cmp[i] != 0) return cmp[i];
            // if we're here the fields are identical
            // we compare RecordNo when the index is NOT unique
            if (index.mNdxHeader.UniqueFlag) return 0;
            else return DbfRecordNo.CompareTo(other.DbfRecordNo);

        public override string ToString()
            return Fields.ToString() + " " + DbfRecordNo.ToString();

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.


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


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

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