Click here to Skip to main content
15,886,705 members
Articles / Database Development / SQL Server

Database Helper Class Library to Ease Database Operation

Rate me:
Please Sign up or sign in to vote.
3.09/5 (9 votes)
14 Apr 2007CPOL4 min read 87.6K   3K   57  
Database Helper Class Library to Ease Database Operation
///////////////////////////////////////////////////////////////////////////
// Copyright 2003-2005 Falcon Soon
//
// Author: Soon Chun Boon
// Date: 12 Oct 2003
// Description: 
// Connection Provider interface for database connection sharing.  
// This interface implements IDisposable.
///////////////////////////////////////////////////////////////////////////

using System;
using System.Data;

namespace DBHelper
{
	/// <summary>
	/// Provides a general interface of methods and properties for Connection Provider.
	/// </summary>
	public interface IConnectionProvider : IDisposable
	{
        /// <summary>
        /// Opens a database connection.
        /// </summary>
        /// <returns>True if succeeded.</returns>
		bool OpenConnection();

        /// <summary>
        /// Closes a database connection.
        /// </summary>
        /// <returns>True if succeeded.</returns>
        bool CloseConnection();

        /// <summary>
        /// Return a database connection.
        /// </summary>
        IDbConnection DBConnection
        {
            get;
        }

        /// <summary>
        /// Sets a database connection string.
        /// </summary>
        string ConnectionString
        {
            set;
        }
	}
}

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

Comments and Discussions