|
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Data.Common;
/*****************************************************************************
* DALC4NET IS AN OPEN SOURCE DATA ACCESS LAYER
* THIS DOES NOT REQUIRE ANY KIND OF LICENSEING
* USERS ARE FREE TO MODIFY THE SOURCE CODE AS PER REQUIREMENT
* ANY SUGGESTIONS ARE MOST WELCOME (SEND THE SAME TO AK.TRIPATHI@YAHOO.COM WITH DALC4NET AS SUBJECT LINE
* ---------------- AUTHOR DETAILS--------------
* NAME : ASHISH TRIPATHI
* LOCATION : BANGALORE (INDIA)
* EMAIL : AK.TRIPATHI@YAHOO.COM
* MOBILE : +91 98809 46821
******************************************************************************/
namespace DALC4NET
{
internal class CommandBuilder
{
private string _providerName = string.Empty;
private DBParamBuilder _paramBuilder = null;
private AssemblyProvider _assemblyProvider = null;
public CommandBuilder()
{
this._providerName = Configuration.GetProviderName(Configuration.DefaultConnection);
_paramBuilder = new DBParamBuilder(this._providerName);
_assemblyProvider = new AssemblyProvider(this._providerName);
}
public CommandBuilder(string providerName)
{
this._providerName = providerName;
_paramBuilder = new DBParamBuilder(providerName);
_assemblyProvider = new AssemblyProvider(this._providerName);
}
#region Inrernal Methods
internal IDbCommand GetCommand(string commandText, IDbConnection connection)
{
return GetCommand(commandText, connection, CommandType.Text);
}
internal IDbCommand GetCommand(string commandText, IDbConnection connection, CommandType commandType)
{
IDbCommand command = GetCommand();
command.CommandText = commandText;
command.Connection = connection;
command.CommandType = commandType;
return command;
}
internal IDbCommand GetCommand(string commandText, IDbConnection connection, DBParameter parameter)
{
return GetCommand(commandText, connection, parameter, CommandType.Text);
}
internal IDbCommand GetCommand(string commandText, IDbConnection connection, DBParameter parameter, CommandType commandType)
{
IDataParameter param = _paramBuilder.GetParameter(parameter);
IDbCommand command = GetCommand(commandText, connection, commandType);
command.Parameters.Add(param);
return command;
}
internal IDbCommand GetCommand(string commandText, IDbConnection connection, DBParameterCollection parameterCollection)
{
return GetCommand(commandText, connection, parameterCollection, CommandType.Text);
}
internal IDbCommand GetCommand(string commandText, IDbConnection connection, DBParameterCollection parameterCollection, CommandType commandType)
{
List<DbParameter> paramArray = _paramBuilder.GetParameterCollection(parameterCollection);
IDbCommand command = GetCommand(commandText, connection, commandType);
foreach (IDataParameter param in paramArray)
command.Parameters.Add(param);
return command;
}
#endregion
#region Private Methods"
private IDbCommand GetCommand()
{
//IDbCommand command = AssemblyProvider.GetInstance(_providerName).Factory.CreateCommand();
IDbCommand command = _assemblyProvider.Factory.CreateCommand();
return command;
}
#endregion
}
}
|
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.
• 8 years of experience in IT Industry as a Developer.
• Experience of End-To-End Software Development and Implementation (Entire SDLC i.e Software Development Life Cycle)
• Real time Exposure to Banking, Finance and Energy industry.
• Expertise in distributed application architecture as well as web based applications using Microsoft.NET platform.
• Expertise in database design, SQL programming and SQL performance tuning.
• Expertise in Web Services and WCF Services.
• Experience of Rich Internet Application using Adobe Flex.
• Experience in migration of legacy application to latest technology, migration of VB application to .NET.
• Knowledge of OOPS and Design Concepts.
• Expertise in Agile/ Scrum software development processes.
Specialties
• Languages\ Technologies-
.NET Framework 1.1/2.0/3.0/3.5, C#.NET, VB.NET, ASP.NET, VB6, AJAX, ASP.NET, Adobe Flex 3.0, Web Services, Windows Communication Foundation (WCF), LINQ, SQL Server, Oracle, MySql, MS Access, HTML, XML, JavaScript, C# Script, CSS and XSLT.
• Methodology/ Concepts-
OOPS, Data Structures, Design Concepts and Agile/ Scrum Software Development