Retrieve data from stored procedure using syncframework.
-
11 kwietnia 2012 05:01
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
Wszystkie odpowiedzi
-
11 kwietnia 2012 05:21Moderator
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.
-
11 kwietnia 2012 05:37
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 ?
-
11 kwietnia 2012 05:43Moderator
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?- Zmodyfikowany przez JuneTMVP, Moderator 11 kwietnia 2012 05:45
-
11 kwietnia 2012 06:09
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.
-
11 kwietnia 2012 06:24Moderator
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.
-
11 kwietnia 2012 10:01Moderator
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?