public DataTable ExecuteDataTable(CommandType commandType, string commandText) { try { 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(); if (dataSet.Tables.Count > 0) { return(dataSet.Tables[0]); } return(null); } catch (Exception) { throw; } }
private IDbDataAdapter CreateCommandAndDataAdapter() { //Command and Adapter creation this.idbCommand = DBManagerFactory.GetCommand(this.ProviderType); IDbDataAdapter dataAdapter = DBManagerFactory.GetDataAdapter (this.ProviderType); return(dataAdapter); }
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); }
public DataSet ExecuteDataSet(CommandType commandType, string commandText) { if (this.Connection == null) { Open(); } this.idbCommand = DBManagerFactory.GetCommand(this.ProviderType); this.idbCommand.CommandTimeout = 0; 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); // TODO: only clear out parameters if none of the parameters are of type output // idbCommand.Parameters.Clear(); return(dataSet); }
public DataSet SetDataSetForUpdate(CommandType commandType, string commandText) { try { 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; UpdateDataSet = new DataSet(); dataAdapter.Fill(UpdateDataSet); idbCommand.Parameters.Clear(); return(UpdateDataSet); } catch (Exception) { throw; } }