I am having implementing a stored procedure and returning a complex type. Here is the stored proc ALTER PROCEDURE [dbo].[PromoCatalogItem_TotalQuantity] @promoCatalog_ID decimal(18,0), @member_ID decimal(18,0) AS BEGIN SET NOCOUNT ON; SELECT PromoCatalog_Item_ID, SUM(T2.Promo.value('(DATACOUNT)[1]', 'decimal(18,6)')) AS TotalOnQuantity , COUNT(*) as Times FROM Member_Promocatalog_Data CROSS APPLY ReportData1.nodes('/DATA/ONPROMO') T2(Promo) WHERE Member_PromoCatalog_ID = @promoCatalog_ID AND ReceiverID = @member_ID GROUP BY PromoCatalog_Item_ID END I wish to return a complex type which is the rows from the SELECT statement. I have created a FunctionImport defined for this stored proc but I am unable to return the results. I have verified that the correct paramters are passed to the SP and I have validated that the SP returns a result with this parameters using SQL Enterprise Manager. Here is the code I am using in Silverlight public INotifyCompleted load_PromoCatalogItemOrderLevels_Coroutine( Decimal promoCatalogID, Decimal memberID) { var q = mgrPromoCatalog.PromoCatalogItem_TotalQuantityQuery(memberID, promoCatalogID); return mgrPromoCatalog.ExecuteQueryAsync(q); } and I call this in a Coroutine using StartParallel. Here is the Completed handler ( I Have deleted other code to minimize the amount of text ) public void load_MemberPromoCatalogEntities(Member_PromoCatalog memberPromoCatalog, Decimal memberID) { var coop = Coroutine.StartParallel(() => load_MemberPromoCatalogEntitiesCoroutine(memberPromoCatalog, memberID)); coop.Completed += (sender, args) => { if (args.CompletedSuccessfully) { //get the results from our stored procedure call var results = args.Notifications[5] } else { } }; } I see no errors in the results but I have not data returning. Any help would be appreciated
|