Exemple #1
0
        public string ExecuteOne(string strSql)
        {
            switch (_dbType)
            {
            case DatabaseType.Sqlserver:
                return(SqlServerUtil.ExecuteOne(DbConnectionString, strSql));

            //sunjian 2020/2/13 增加MySql的ExecuteOne方法
            case DatabaseType.Mysql:
                return(MySqlUtil.ExecuteOne(DbConnectionString, strSql));

            default:
                return("");
            }
        }
Exemple #2
0
        public DataSet GetDataSet(CommandType cmdType, string cmdText)
        {
            switch (_dbType)
            {
            case DatabaseType.Sqlserver:
                return(SqlServerUtil.GetDataSet(DbConnectionString, cmdType, cmdText));

            case DatabaseType.Mysql:
                return(MySqlUtil.GetDataSet(DbConnectionString, cmdType, cmdText));

            case DatabaseType.Oracle:
                return(OracleUtil.GetDataSet(DbConnectionString, cmdType, cmdText));

            case DatabaseType.Access:
                return(AccessUtil.GetDataSet(DbConnectionString, cmdText));

            default:
                return(null);
            }
        }
Exemple #3
0
        public int ExecuteNonQuery(CommandType cmdType, string cmdText)
        {
            switch (_dbType)
            {
            case DatabaseType.Sqlserver:
                return(SqlServerUtil.ExecuteNonQuery(DbConnectionString, cmdType, cmdText));

            case DatabaseType.Mysql:
                return(MySqlUtil.ExecuteNonQuery(DbConnectionString, cmdType, cmdText));

            case DatabaseType.Oracle:
                return(OracleUtil.ExecuteNonQuery(DbConnectionString, cmdType, cmdText));

            case DatabaseType.Access:
                return(AccessUtil.ExecuteNonQuery(DbConnectionString, cmdText));

            default:
                return(-1);
            }
        }