Skip to content

Instantly share code, notes, and snippets.

@lluisfranco
Created December 12, 2017 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lluisfranco/fa533bf864fb95b45ebb0eaf0e07c76f to your computer and use it in GitHub Desktop.
Save lluisfranco/fa533bf864fb95b45ebb0eaf0e07c76f to your computer and use it in GitHub Desktop.
using (var conn = new AdomdConnection(connectionString))
{
conn.Open();
var commandText = @"SELECT
{
[Measures].[Gains Period],
[Measures].[Gains YTD],
[Measures].[Amount]
} ON COLUMNS,
[Valuation Dates Accumulated].[Hierarchy].[Year].Members ON ROWS
FROM Accumulated
Where ({ @PortfolioId })";
var data = conn.Query<MyResultDTO>(commandText,
new AdomdParameterMultipleValues<int>()
{
ParameterName = "@PortfolioId",
MemberName = "[Portfolios].[Port Code]",
Values = new List<int>() { 282, 185 }
}
);
conn.Close();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment