In my recent CFDJ article on ColdFusion and .NET via Web Services, I wrote about a somewhat ugly way to send CF Queries to .NET. At the time, I struggled with finding a better solution, but couldn't get anything else to work.
I revisited the problem recently, and found that I now seem to be able to get data out of the QueryBean result that'll let me use a CF Query in .NET without performing any sort of transformation on the CF side.
You'll probably still need to perform some .NET-side transformation to get a bindable result, but at least you can now do transformation only if needed.
Without any further ago, here's a sample CFC that returns a query:
<cffunction name="getQuery" access="remote" returnType="query">
<cfset var query = queryNew("Id,Value") />
<cfset var i = "" />
<cfset var j = "" />
<cfloop from="1" to="#randRange(50, 100)#" index="i">
<cfset queryAddRow(query, 1) />
<cfset querySetCell(query, "Id", "Id_" & i, i) />
<cfset querySetCell(query, "Value", "Value_" & i, i) />
<cfreturn query />
And a C# client for it (assuming you've built a web reference to the CFC's wsdl in the queryTest namespace):
queryTest.queryServiceService myService = new queryTest.queryServiceService();
queryTest.QueryBean result = myService.getQuery();
Response.Write("Query Results:<br />");
Response.Write(result.columnList[i] + " ");
Object row = (Object) result.data[i];
Response.Write((string) row[j] + " ");