SQLHelper.cs in DataBaseAccess.rar


C# Basic types of database access. C# Basic types of database access....Original Link
    Sponsored links

			
//===============================================================================
// This file is based on the Microsoft Data Access Application Block for .NET
// For more information please go to 
// http://msdn.microsoft.com/library/en-us/dnbda/html/daab-rm.asp
//===============================================================================

using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Collections;

namespace Maticsoft.DBUtility
{

    /// <summary>
    /// The SqlHelper class is intended to encapsulate high performance, 
    /// scalable best practices for common uses of SqlClient.
    /// </summary>
    public abstract class SqlHelper
    {

        //Database connection strings
        public static readonly string ConnectionStringLocalTransaction =  ConfigurationManager.AppSettings["SQLConnString1"];
        public static readonly string ConnectionStringInventoryDistributedTransaction =  ConfigurationManager.AppSettings["SQLConnString2"];
        public static readonly string ConnectionStringOrderDistributedTransaction =  ConfigurationManager.AppSettings["SQLConnString3"];
        public static readonly string ConnectionStringProfile =  ConfigurationManager.AppSettings["SQLProfileConnString"];

        // Hashtable to store cached parameters
        private static Hashtable parmCache = Hashtable.Synchronized(new Hashtable());

        /// <summary>
        /// Execute a SqlCommand (that returns no resultset) against the database specified in the connection string 
        /// using the provided parameters.
        /// </summary>
        /// <remarks>
        /// e.g.:  
        ///  int result = ExecuteNonQuery(connString, CommandType.StoredProcedure, "PublishOrders", new SqlParameter("@prodid", 24));
        /// </remarks>
        /// <param name="connectionString">a valid connection string for a SqlConnection</param>
        /// <param name="commandType">the CommandType (stored procedure, text, etc.)</param>			

			...
			...
			... to be continued.

  This is a preview. To get the complete source file, 
  please click here to download the whole source code package.

			
			


Project Files

    Sponsored links
NameSizeDate
 <DBUtility>0.00 B01-03-08 19:53
 AssemblyInfo.cs584.00 B11-10-07 22:05
 CommandInfo.cs2.13 kB11-10-07 22:06
 DbHelperOleDb.cs18.49 kB15-02-08 21:00
 DbHelperOra.cs14.63 kB21-11-07 22:50
 DbHelperSQL.cs39.68 kB21-11-07 22:31
 DbHelperSQL2.cs18.34 kB24-08-06 22:12
 DbHelperSQLP.cs39.66 kB21-11-07 22:32
 DBUtility.csproj4.49 kB15-02-08 20:59
 DBUtility.csproj.user168.00 B15-02-08 21:00
 DBUtility.suo23.00 kB11-10-07 22:08
 DESEncrypt.cs2.92 kB11-10-07 22:06
 OracleHelper.cs25.27 kB11-10-07 22:06
 PubConstant.cs1.37 kB21-11-07 22:33
 SQLHelper.cs12.07 kB11-10-07 22:07
 vssver2.scc354.00 B20-09-07 13:32
 AssemblyInfo.cs584.00 B11-10-07 22:05
 CommandInfo.cs2.13 kB11-10-07 22:06
 DbHelperOleDb.cs18.49 kB15-02-08 21:00
 DbHelperOra.cs14.63 kB21-11-07 22:50
 DbHelperSQL.cs39.68 kB21-11-07 22:31
 DbHelperSQL2.cs18.34 kB24-08-06 22:12
 DbHelperSQLP.cs39.66 kB21-11-07 22:32
 DBUtility.csproj4.49 kB15-02-08 20:59
 DBUtility.csproj.user168.00 B15-02-08 21:00
 DBUtility.suo23.00 kB11-10-07 22:08
 DESEncrypt.cs2.92 kB11-10-07 22:06
 OracleHelper.cs25.27 kB11-10-07 22:06
 PubConstant.cs1.37 kB21-11-07 22:33
 SQLHelper.cs12.07 kB11-10-07 22:07
 vssver2.scc354.00 B20-09-07 13:32
 <DataBaseAccess>0.00 B19-07-08 01:08
 <DataBaseAccess>0.00 B19-07-08 01:09
...

Related Items

    Sponsored links