If I have a coded sql query I want to run before a test and also use the returned values (ID and Company) to "dynamically" set the local data so that the test will run multiple iterations against the values
Add a coded step to set the results from SQL query to a collection. You need to declare the collection as static in the test's class, which will hold the results from the SQL query. In my example I used a List<string> to create a simple scenario.
Add another coded step before you use the local data in your test. Here is when you need to overwrite the empty local data values with the ones from the static collection. Please check the sample code in step 4 for more details.
I hope this help you with the scenario at hand. If you need further assistance, please share more details about the test and code you currently have.