Click here to Skip to main content
15,894,646 members
Articles / Desktop Programming / Windows Forms

SQLite Compare Utility

Rate me:
Please Sign up or sign in to vote.
4.89/5 (68 votes)
21 Feb 2015LGPL35 min read 285.1K   37.2K   131  
Utility for comparing two SQLite database files for both structure and data
using System;
using System.Collections.Generic;
using System.Text;

namespace FastGridApp
{
    /// <summary>
    /// Represents a location in the grid (Row/Column)
    /// </summary>
    public struct FastGridLocation
    {
        public static readonly FastGridLocation Empty = new FastGridLocation(long.MinValue, int.MinValue);

        public FastGridLocation(long row, int col)
        {
            RowIndex = row;
            ColumnIndex = col;
        }

        public override bool Equals(object obj)
        {
            if (obj == null)
                return false;

            if (!(obj is FastGridLocation))
                return false;

            FastGridLocation loc = (FastGridLocation)obj;
            if (loc.RowIndex != RowIndex)
                return false;
            if (loc.ColumnIndex != ColumnIndex)
                return false;

            return true;
        }

        public static bool operator ==(FastGridLocation obj1, FastGridLocation obj2)
        {
            return obj1.Equals(obj2);
        }

        public static bool operator !=(FastGridLocation obj1, FastGridLocation obj2)
        {
            return !obj1.Equals(obj2);
        }

        public override int GetHashCode()
        {
            return RowIndex.GetHashCode() * ColumnIndex.GetHashCode();
        }

        public override string ToString()
        {
            return "Row=" + RowIndex + ",Col=" + ColumnIndex;
        }

        public long RowIndex;
        public int ColumnIndex;
    }
}

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 GNU Lesser General Public License (LGPLv3)


Written By
Software Developer
Israel Israel
My name is Liron Levi and I'm developing software for fun & profit for 15 years already.

Comments and Discussions