views:

95

answers:

1

I am using RIA Services with Silverlight and Entity Framework. I want to call a stored procedure and map the results to a datagrid. What is the best way to do this? The output of the stored procedure doesn't map to any table design.

I found the following article -

http://blogs.msdn.com/b/tom/archive/2009/05/07/silverlight-ria-calling-stored-procedures-that-don-t-return-tables.aspx

However, it doesn't work for me - I get an error saying that the result complex set does not have a primary key defined. I can't see how to define this in code.

Anyway, I'm open to any and all solutions.

+1  A: 

Well, I figured out how to do it, though it's a bit messy. You need to create a metadata class for the result set in the domain metadata file. After that, RIA will treat it essentially like it does an entity.

Full details can be found here - http://leeontech.wordpress.com/2010/05/24/ria-services-and-storedprocedures/

CraigS