Is there a way to do this in C# not in a macro? Sorry my OP was confusing. I am actually invoking a macro method to call C# code and I want to run the query there.
Your answer is exactly what I'm looking for though, other than I need to call that in the app code not in the macro itself. I just checked for something similar in intellisense and I couldn't find any methods that I could port your code to.
Thanks for the help!