Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Database Helper Class Library to Ease Database Operation

, 14 Apr 2007 CPOL
Database Helper Class Library to Ease Database Operation
article_demo.zip
DBHelperQuickRelationshipSamples
DBHelperQuickRelationshipSamples
App.ico
DBHelperQuickRelationshipSamples.csproj.user
DBHelperQuickRelationshipSamples.suo
DBHelperQuickSelectSamples
DBHelperQuickSelectSamples
DBHelperQuickSelectSamples.csproj.user
DBHelperQuickSelectSamples.suo
DBHelperQuickHelperSamples
DBHelperQuickHelperSamples
App.ico
DBHelperQuickHelperSamples.csproj.user
DBHelperQuickHelperSamples.suo
DBHelperQuickInsUpdDelSamples
DBHelperQuickInsUpdDelSamples
DBHelperQuickInsUpdDelSamples.csproj.user
DBHelperQuickInsUpdDelSamples.suo
article_src.zip
Microsoft.ApplicationBlocks.ExceptionManagement.Interfaces
Microsoft.ApplicationBlocks.ExceptionManagement.Interfaces.csproj.user
Microsoft.ApplicationBlocks.ExceptionManagement.suo
DbHelper
DBHelper.chm
DBHelper.csproj.user
DbHelper.ndoc
DBHelper.suo
Microsoft.ApplicationBlocks.ExceptionManagement
ExceptionManagerText.xsx
Microsoft.ApplicationBlocks.ExceptionManagement.csproj.user
Microsoft.ApplicationBlocks.suo
///////////////////////////////////////////////////////////////////////////
// Copyright 2003-2005 Falcon Soon
//
// Author: Soon Chun Boon
// Date: 10 October 2004
// Description: 
// Class that consists of useful comparison methods used by data operation.
///////////////////////////////////////////////////////////////////////////

using System;
using System.Globalization;

namespace DBHelper
{
	/// <summary>
	/// Class that consists of useful comparison methods used by data operation.
	/// </summary>
	internal class InternalDataComparationBase
	{
        /// <summary>
        /// Compares 2 strings.
        /// </summary>
        /// <param name="s1">First string to compare with.</param>
        /// <param name="s2">Second string to compare with.</param>
        /// <param name="bCaseSensitive">Value specifies whether comparison is case sensitive.</param>
        /// <param name="locale">The culture info.</param>
        /// <returns>If comparison is case sensitive, 1 is returned if 2 strings are same, otherwise 0
        /// is returned. If comparison is case insensitive, 1 is return if 2 strings are same exactly
        /// (all case are same), -1 is return if 2 strings are same (not all case are same), and
        /// 0 is returned if 2 strings are not same.</returns>
        static internal int NamesEqual(string s1, string s2, bool bCaseSensitive, CultureInfo locale)
        {
            if (bCaseSensitive)
            {
                if (string.Compare(s1, s2, false, locale) == 0)
                {
                    return 1;
                }
                return 0;
            }
            if (locale.CompareInfo.Compare(s1, s2, (CompareOptions.IgnoreWidth | (CompareOptions.IgnoreKanaType | CompareOptions.IgnoreCase))) != 0)
            {
                return 0;
            }

            if (string.Compare(s1, s2, false, locale) == 0)
            {
                return 1;
            }
            return -1;
        }
	}
}

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

falconsoon

Malaysia Malaysia
Had worked as analyst programmer for 4 years. Now helping in family business but still involved actively in .Net development whenever there is a free time.

| Advertise | Privacy | Mobile
Web04 | 2.8.141022.2 | Last Updated 14 Apr 2007
Article Copyright 2007 by falconsoon
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid