So,
Here is the promised full code. I created this example for Nick. What is special about this code is, that it does not rely on LabVIEW Database Connectivity Toolkit; due to MS drivers used in that code that only exist in 32-bit, this toolkit is not available for LabVIEW 64-bit. Therefore using e.g. .NET is necessary to connect to a database with LabVIEW 64-bit.
Nick was using a MySQL database (see his VI attached above), however my example code should work with MS SQL and other SQL database systems in a similar fashion.
For this example, I was using MySQL Community Server 8.0.12, MySql.data.dll from MySQL Connector/NET 8.0.12, and the example database "Sakila" that comes with the server.
My examples convert all data to strings, as this way it is possible to dynamically define a query. Only using a predefined query with known result column types one can define the type(s) to use during edit-time of the VI. To come around this limitation, one can of course use the variant data type.
Attached are two different versions; one that iterates through all results on the server, and one that writes the query results to a DataTable and transfers this table to the client all at once. Both are attached as LabVIEW 2017 and 2014 versions.
Keep in mind that this is example code I created, so it's mostly untested. Do not use it in production environment or with sensitive/important data before testing it thoroughly!
Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0