public object ExecuteScalar(string parCommandText, DbParamCollection parDbParameters) { this.OpenConnection(); object obj = (object)null; try { obj = this.CreateCommand(parCommandText, parDbParameters).ExecuteScalar(); } catch (Exception ex) { } this.CloseConnecion(); return(obj); }
public int ExecuteNonQuery(string parCommandText, DbParamCollection parDbParameters) { this.OpenConnection(); int num = 0; try { num = this.CreateCommand(parCommandText, parDbParameters).ExecuteNonQuery(); } catch (Exception ex) { } this.CloseConnecion(); return(num); }
public DbCommand CreateCommand(string parCommandText, DbParamCollection parDbParameters) { DbCommand command = this.insDbProviderFactory.CreateCommand(); command.CommandText = parCommandText; command.CommandType = CommandType.StoredProcedure; if (parDbParameters != null) { command.Parameters.AddRange((Array)parDbParameters.ToArray()); } command.Connection = this._Connection; if (this._Transaction != null) { command.Transaction = this._Transaction; } return(command); }
public DataTable ExecuteDataTable(string parCommandText, DbParamCollection parDbParameters, bool parIsCached) { DataTable dataTable = new DataTable(); if (parIsCached) { if (AppDomain.CurrentDomain.GetData(parCommandText) == null) { this.OpenConnection(); DbDataAdapter dataAdapter = this.insDbProviderFactory.CreateDataAdapter(); dataAdapter.SelectCommand = this.CreateCommand(parCommandText, parDbParameters); try { dataAdapter.Fill(dataTable); } catch (Exception ex) { } this.CloseConnecion(); AppDomain.CurrentDomain.SetData(parCommandText, (object)dataTable); } else { dataTable = (DataTable)AppDomain.CurrentDomain.GetData(parCommandText); } } else { this.OpenConnection(); DbDataAdapter dataAdapter = this.insDbProviderFactory.CreateDataAdapter(); dataAdapter.SelectCommand = this.CreateCommand(parCommandText, parDbParameters); try { dataAdapter.Fill(dataTable); } catch (Exception ex) { } this.CloseConnecion(); } return(dataTable); }
public DataTable ExecuteDataTable(string parCommandText, DbParamCollection parDbParameters) { return(this.ExecuteDataTable(parCommandText, parDbParameters, false)); }