Esempio n. 1
0
        public DBManager(string connectionString)
        {
            this.connectionString = connectionString;

            DBManagerSingletonConnection.ConnectionString = this.connectionString;

            idbConnection = DBManagerSingletonConnection.GetConnection();
        }
Esempio n. 2
0
 public void BeginTransaction()
 {
     if (this.idbTransaction == null)
     {
         idbTransaction =
             DBManagerSingletonConnection.GetTransaction();
     }
     this.idbCommand.Transaction = idbTransaction;
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
 //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);
 }
Esempio n. 7
0
 public void CreateParameters(int paramsCount)
 {
     idbParameters = new IDbDataParameter[paramsCount];
     idbParameters = DBManagerSingletonConnection.GetParameters(paramsCount);
 }