예제 #1
0
        public static int Execute(String sql, IDbConnection cn)
        {
            logger.Info(LoggerUtil.SqlPrefix + "execute sql : " + sql);
            IDbCommand cmd    = DataFactory.GetCommand(sql, cn);
            int        result = cmd.ExecuteNonQuery();

            logger.Info("affected : " + result);
            return(result);
        }
예제 #2
0
        public static Object ExecuteScalar(String sql, IDbConnection cn)
        {
            Object result = null;

            logger.Info(LoggerUtil.SqlPrefix + "execute sql:" + sql);
            result = DataFactory.GetCommand(sql, cn).ExecuteScalar();
            if (result == DBNull.Value)
            {
                return(null);
            }
            return(result);
        }
예제 #3
0
 public static IDataReader ExecuteReader(String sql, IDbConnection cn)
 {
     logger.Info(LoggerUtil.SqlPrefix + "execute sql:" + sql);
     return(DataFactory.GetCommand(sql, cn).ExecuteReader());
 }