public static DataTable GetSchemaTable(string selectSql, IDbAccess dataAccess) { if (String.IsNullOrEmpty(selectSql)) return null; DataTable schemaTable; Dictionary<string, DataTable> schemaDic = SchemaDic; if (!schemaDic.TryGetValue(selectSql, out schemaTable)) { string schemaSql = "SELECT TOP 0 * FROM (" + selectSql + ") T"; schemaTable = dataAccess.QueryDataTable(schemaSql.ToQuery()); schemaDic.Add(selectSql, schemaTable); } return schemaTable; }