Ejemplo n.º 1
0
        /// <summary>
        /// /Create Sql Command
        /// </summary>
        /// <param name="commandText"></param>
        /// <param name="cmdType"></param>
        /// <param name="collection"></param>
        /// <returns></returns>
        public CSqlDbCommand CreateCommand(string commandText, CommandType cmdType, CSqlDbParameterCollection collection)
        {
            var cmd = new CSqlDbCommand(commandText, cmdType);

            cmd.Parameters = collection;
            Parameters     = cmd.Parameters;
            return(cmd);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Set Parameter all properties
 /// </summary>
 /// <param name="dbParameters"></param>
 /// <returns></returns>
 private SqlParameter[] GetParametersWithNativeType(CSqlDbParameterCollection dbParameters)
 {
     SqlParameter[] paramArray = new SqlParameter[dbParameters.Count];
     for (int i = 0; i < dbParameters.Count; i++)
     {
         paramArray[i]           = new SqlParameter("@" + dbParameters[i].ParameterName, (dbParameters[i].Value == null) ? DBNull.Value : dbParameters[i].Value);
         paramArray[i].Direction = dbParameters[i].Direction;
         paramArray[i].Size      = dbParameters[i].Size;
         paramArray[i].DbType    = dbParameters[i].DbType;
     }
     return(paramArray);
 }
Ejemplo n.º 3
0
 public CSqlDbCommand()
 {
     _paramterCollection = new CSqlDbParameterCollection();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Connection Initialization
 /// </summary>
 public override void Initialize()
 {
     //default set to procedure
     _sqlCon             = new SqlConnection(_connectionString);
     _sqlParamCollection = new CSqlDbParameterCollection();
 }