I'm trying to figure out how to obtain the results of a SQL Server stored procedure using Codefluent. I have a well developed CF project, but there is one very complicated stored procedure that I don't want to monkey around with.
Basically, the procedure takes a series of input parameters and returns rows from a table. From this standpoint it is fairly simple, though the underlying T-SQL is not. The column names returned are not the original column names in the underlying tables which is why I am also looking to use a raw CF procedure.
I've tried a variety of approaches. I created a view and a raw procedure - (the view inferred model seemed to like this one)
<cf:view autoLightweight="true" name="myLWview">
<cf:viewProperty name="field1" />
<cf:viewProperty name="field2" />
...
<cf:viewProperty name="fieldn" />
</cf:view>
<cf:method name="GetLog" returnTypeName="list(of myLWview)">
<cf:body text="RAW (parameter1, parameter2, ..., parametern)" rawText="select [field1], [field2], ... , [fieldn] from mySQLprocedure" language="tsql" />
</cf:method>
This fails on the ExecuteReader
call.
I'm sure it is something obvious I'm missing. Any advice would be greatly appreciated. Thanks!