i am using the following code in the datalayer. The input paramters are the stored procedure and the associated parameters provided as a HastTable. I am using Enterprise Library, Data Access Block.

namespace EPD.Data
    public class DBManager
        static Microsoft.Practices.EnterpriseLibrary.Data.Database dataBase;     
        static DbCommand oDbCommand;     
        public static CommandResult ExecForScalar(string procName, Hashtable paramValCol)
            CommandResult cmdResult;
                dataBase = Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.CreateDatabase();
                CommonManager.PrepareCommand(ref dataBase, ref oDbCommand, procName, paramValCol);
                cmdResult = CommonManager.BuildResult(dataBase.ExecuteScalar(oDbCommand), 

            catch (SqlException ex)
                cmdResult = CommonManager.BuildResult(ex);
            catch (Exception ex)
                cmdResult = CommonManager.BuildResult(ex, (int)ExceptionHandler.ErrorCode.NonSQL);
            return cmdResult;
}  }


I invoke the method from the business layer as follows: CommandResult result = EPD.Data.DBManager.ExecForScalar("proc", hash table containing the parameters); Question:
since the basic method is static and need to know if it affects the concurrent users.

That's a good question. I wonder... given that it would run on different sessions how that would affect anything.

This article has been dead for over six months. Start a new discussion instead.