Ejemplo n.º 1
0
        public object ExecuteScalar(CommandType commandType, string commandText)
        {
            this.idbCommand = DBManagerFactory.GetCommand(this.ProviderType);
            PrepareCommand(idbCommand, this.Connection, this.Transaction, commandType, commandText, this.Parameters);
            object returnValue = idbCommand.ExecuteScalar();

            idbCommand.Parameters.Clear();
            return(returnValue);
        }
Ejemplo n.º 2
0
        public DataSet ExecuteDataSet(CommandType commandType, string commandText)
        {
            this.idbCommand = DBManagerFactory.GetCommand(this.ProviderType);
            PrepareCommand(idbCommand, this.Connection, this.Transaction, commandType, commandText, this.Parameters);
            IDbDataAdapter dataAdapter = DBManagerFactory.GetDataAdapter(this.ProviderType);

            dataAdapter.SelectCommand = idbCommand;
            DataSet dataSet = new DataSet();

            dataAdapter.Fill(dataSet);
            idbCommand.Parameters.Clear();
            return(dataSet);
        }
Ejemplo n.º 3
0
 public int ExecuteNonQuery(CommandType commandType, string commandText)
 {
     try
     {
         this.idbCommand = DBManagerFactory.GetCommand(this.ProviderType);
         PrepareCommand(idbCommand, this.Connection, this.Transaction, commandType, commandText, this.Parameters);
         int returnValue = idbCommand.ExecuteNonQuery();
         idbCommand.Parameters.Clear();
         this.Parameters = null;
         return(returnValue);
     }
     catch (Exception ex)
     {
         ErrorHandler.ThrowError(ex);
         return(-1);
     }
 }
Ejemplo n.º 4
0
 public IDataReader ExecuteReader(string commandText, CommandType commandType)
 {
     try
     {
         this.idbCommand       = DBManagerFactory.GetCommand(this.ProviderType);
         idbCommand.Connection = this.Connection;
         PrepareCommand(idbCommand, this.Connection, this.Transaction, commandType, commandText, this.Parameters);
         this.DataReader = idbCommand.ExecuteReader();
         idbCommand.Parameters.Clear();
         return(this.DataReader);
     }
     catch (Exception ex)
     {
         ErrorHandler.ThrowError(ex);
         return(null);
     }
 }
Ejemplo n.º 5
0
        public void Open()
        {
            try
            {
                idbConnection = DBManagerFactory.GetConnection(this.providerType);
                idbConnection.ConnectionString = this.ConnectionString;

                if (idbConnection.State != ConnectionState.Open)
                {
                    idbConnection.Open();
                }

                this.idbCommand = DBManagerFactory.GetCommand(this.ProviderType);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }