Retrieve data from stored procedure using syncframework.
-
Wednesday, April 11, 2012 5:01 AM
I was able to run the syncframework sample app based on the provisioned database.
The database itself contains several stored procedure which themselves serves as the business logic. my client has a special requirement. they want to run these stored procedures during sync and return data to client. Is there any way to run stored procedure during sync operation.
Thanks
Bijo Abraham
All Replies
-
Wednesday, April 11, 2012 5:21 AMModerator
not via the Sync APIs. you cant specify in Sync Framework to run stored procs for you.
there is no stopping you though from subscribing to the events in Sync Framework (AppliedChanges, ChangesSelected, etc...whichever is appropriate for you) and calling the stored procedures yourself.
-
Wednesday, April 11, 2012 5:37 AM
Thanks Junet for your reply.
Is there any way to execute stored procedure and return values as response?.for ex: can I use wcf rest service or any other possible methods are there ?
-
Wednesday, April 11, 2012 5:43 AMModerator
do you need to run the stored proc while sync is in progress? can you not do it after the sync? what happens to the sync while you return values to the client?
it would help if you cite samples of what the stored procs do and how are those stored procs related to sync. do you need to run those stored procs to validate the data being synched?- Edited by JuneTMVP, Moderator Wednesday, April 11, 2012 5:45 AM
-
Wednesday, April 11, 2012 6:09 AM
Its not necessary to run stored proc while sync in progress. It can be run after sync also.
The requirement is like this: Existing stored proc is using complex logic to filter out records from over 350000 records..so instead of using c# they just want to invoke stored proc and return filtered records.
-
Wednesday, April 11, 2012 6:24 AMModerator
does the filtering have any impact on what should be synched?
"they just want to invoke stored proc and return filtered records" - return to where? what format can the target accept?
the choice of whether you should use WCF REST Service or WebAPI, output to XML or CSV or whatever will depend on the consumer of the results of your stored proc.
-
Wednesday, April 11, 2012 10:01 AMModerator
silverlight on iphone?
so they want to update the output of the stored proc in the client side, then upload back to server? why dont you just dump the output of the stored proc to a table and sync it using the toolkit?