예제 #1
0
        public static DataSet ExecuteDataSet(SqlParam sqlParam, int poolId)
        {
            if (sqlParam == null ||
                string.IsNullOrEmpty(sqlParam.CommondText) ||
                string.IsNullOrEmpty(sqlParam.DataBaseName) ||
                sqlParam.ParamsList.Length < 1)
            {
                return(null);                                 //这里不允许直接传sql语句,必须使用参数化的
            }
            if (poolId < 1)
            {
                poolId = 1;           //默认只有一个数据库
            }
            DBAccess db = getDB(string.Format("{0}.{1}", sqlParam.DataBaseName, poolId));

            return(db.ExecuteDataSet(sqlParam.CommondText, sqlParam.CmdType, sqlParam.ParamsList, sqlParam.Values));
        }