public DBManager(string connectionString) { this.connectionString = connectionString; DBManagerSingletonConnection.ConnectionString = this.connectionString; idbConnection = DBManagerSingletonConnection.GetConnection(); }
public void BeginTransaction() { if (this.idbTransaction == null) { idbTransaction = DBManagerSingletonConnection.GetTransaction(); } this.idbCommand.Transaction = idbTransaction; }
public int ExecuteNonQuery(CommandType commandType, string commandText) { this.idbCommand = DBManagerSingletonConnection.GetCommand(); PrepareCommand(idbCommand, this.Connection, this.Transaction, commandType, commandText, this.Parameters); int returnValue = idbCommand.ExecuteNonQuery(); idbCommand.Parameters.Clear(); return(returnValue); }
public IDataReader ExecuteReader(CommandType commandType, string commandText) { this.idbCommand = DBManagerSingletonConnection.GetCommand(); idbCommand.Connection = this.Connection; PrepareCommand(idbCommand, this.Connection, this.Transaction, commandType, commandText, this.Parameters); this.DataReader = idbCommand.ExecuteReader(); idbCommand.Parameters.Clear(); return(this.DataReader); }
public DataSet GetDataSet(CommandType commandType, string commandText) { this.idbCommand = DBManagerSingletonConnection.GetCommand(); PrepareCommand(idbCommand, this.Connection, this.Transaction, commandType, commandText, this.Parameters); IDbDataAdapter dataAdapter = DBManagerSingletonConnection.GetDataAdapter(); dataAdapter.SelectCommand = idbCommand; DataSet dataSet = new DataSet(); dataAdapter.Fill(dataSet); idbCommand.Parameters.Clear(); return(dataSet); }
//public delegate CollectionBase GenerateCollectionFromReader(object returnData); public DBManager() { try { //this.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["connectionstring"].ToString(); this.connectionString = Properties.Settings.Default.mics_serverConnectionString; } catch { throw new ArgumentException("Configuration file error"); } DBManagerSingletonConnection.ConnectionString = this.connectionString; idbConnection = DBManagerSingletonConnection.GetConnection(); //this(this.providerType,this.connectionString); }
public void CreateParameters(int paramsCount) { idbParameters = new IDbDataParameter[paramsCount]; idbParameters = DBManagerSingletonConnection.GetParameters(paramsCount); }