so, i was trying to implement a stored procedure with multiple results sets in entity framework. it all seemed to be too easy. but, i am not getting any rows for my results sets (even though, it seems i do get the result sets themselves back).
What i have done:
- created the stored procedure which returns 3 result sets
- Created the complex type that represents the return values
- manually edited the edmx file as per Stored Procedures with Multiple Result Sets
- Failed with 3 and tried the code version from the same page, still no rows back.
- Reverted the code back to 3.
my edmx file (related content only):
<FunctionImport Name="getGlobalReport2">
<ReturnType Type="Collection(MTModel.GlobalReport2)"/>
<ReturnType Type="Collection(MTModel.GlobalReport2)"/>
<ReturnType Type="Collection(MTModel.GlobalReport2)"/>
<Parameter Name="regions" Mode="In" Type="String" />
<Parameter Name="countries" Mode="In" Type="String" />
<Parameter Name="companySizes" Mode="In" Type="String" />
<Parameter Name="products" Mode="In" Type="String" />
</FunctionImport>
<FunctionImportMapping FunctionImportName="getGlobalReport2" FunctionName="MTModel.Store.getGlobalReport2" >
<ResultMapping>
<ComplexTypeMapping TypeName="MTModel.GlobalReport2" />
</ResultMapping>
<ResultMapping>
<ComplexTypeMapping TypeName="MTModel.GlobalReport2" />
</ResultMapping>
<ResultMapping>
<ComplexTypeMapping TypeName="MTModel.GlobalReport2" />
</ResultMapping>
</FunctionImportMapping>
my code:
var x = mtEntities.getGlobalReport2(regions, countries, companySizes, products);
Response.Write(x.Count());
var y = x.GetNextResult<GlobalReport2>();
Response.Write(y.Count());
var z = x.GetNextResult<GlobalReport2>();
What i have allready checked:
- Checked that the server receives the request as per How can I view live MySQL queries?
- Run the query i grabbed from the server and made sure it returns result sets and rows
- Debug the app to see there are no Exceptions i missed on the way
There seems to be no issue with the call, or the app, except that no rows are returned. Any suggestions?
EDIT:
as per your comments about the edmx
being overwritten, that would happen only if i regenerate the model from the database, not if i update it.
i wouldn't expect anything else, since its regenerating the model.